hook-emitter
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -136,11 +136,14 @@ 'use strict'; | ||
for (let i = 0, l = listeners.length; i < l; i++) { | ||
const len = listeners.length; | ||
if (len === 1 && listeners[0] === listener) { | ||
// there was only one event and this was it, so | ||
// nuke the entire event from the map | ||
this._events.delete(evt); | ||
continue; | ||
} | ||
for (let i = 0; i < len; i++) { | ||
if (listeners[i] === listener) { | ||
if (l === 1) { | ||
// there was only one event and this was it, so | ||
// nuke the entire event from the map | ||
this._events.delete(evt); | ||
} else { | ||
listeners.splice(i, 1); | ||
} | ||
listeners.splice(i, 1); | ||
break; | ||
@@ -147,0 +150,0 @@ } |
{ | ||
"name": "hook-emitter", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "Event emitter with support for asynchronous handlers and a sweet function hook mechanism.", | ||
@@ -31,2 +31,3 @@ "main": "./dist/index.js", | ||
"esdoc-es7-plugin": "0.0.3", | ||
"eslint": "2.2.0", | ||
"gulp": "^3.9.1", | ||
@@ -33,0 +34,0 @@ "gulp-babel": "^6.1.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
33694
21
6
312
1