Comparing version 1.0.1 to 1.0.2
@@ -28,4 +28,4 @@ 'use strict'; | ||
* | ||
* @param {Array} stack The various of event listeners are async emitted. | ||
* @api public | ||
* @param {Array} stack The listeners for the specified event. | ||
* @api private | ||
*/ | ||
@@ -57,5 +57,5 @@ (function each(stack) { | ||
); | ||
})(listeners); | ||
})(listeners.slice()); | ||
return this; | ||
}; |
{ | ||
"name": "asyncemit", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Asynchronously emit event an event based on the arguments length.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -27,3 +27,3 @@ # asyncemit | ||
``` | ||
```js | ||
var asyncemit = require('asyncemit') | ||
@@ -30,0 +30,0 @@ , EventEmitter = require('eventemitter3'); |
18
test.js
@@ -10,3 +10,3 @@ describe('asyncemit', function () { | ||
beforeEach(function () { | ||
ee = new EventEmitter; | ||
ee = new EventEmitter(); | ||
ee.asyncemit = asyncemit; | ||
@@ -23,3 +23,3 @@ }); | ||
it('returns it self instead of a boolean', function () { | ||
it('returns itself instead of a boolean', function () { | ||
assume(ee.asyncemit('foo', function () {})).equals(ee); | ||
@@ -129,2 +129,16 @@ }); | ||
}); | ||
it('doesn\'t change the original array of listeners', function (next) { | ||
ee.on('foo', function () {}); | ||
ee.on('foo', function () {}); | ||
ee.on('foo', function () {}); | ||
assume(ee.listeners('foo')).has.length(3); | ||
ee.asyncemit('foo', 'bar', function (err) { | ||
assume(err).is.undefined(); | ||
assume(ee.listeners('foo')).has.length(3); | ||
next(); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8885
160