Comparing version 0.0.2 to 0.0.3
@@ -38,3 +38,3 @@ var async = require('async'); | ||
else { | ||
asyncApply(emitter, listeners.pop(), args, callback); | ||
asyncApply(emitter, listeners[0], args, callback); | ||
} | ||
@@ -41,0 +41,0 @@ }; |
{ | ||
"name": "eventflow", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Flow control for your event emitters", | ||
@@ -5,0 +5,0 @@ "main": "eventflow.js", |
@@ -151,14 +151,13 @@ EventFlow | ||
Developed by [Terra Eclipse](http://www.terraeclipse.com) | ||
-------------------------------------------------------- | ||
- - - | ||
### Developed by [Terra Eclipse](http://www.terraeclipse.com) | ||
Terra Eclipse, Inc. is a nationally recognized political technology and | ||
strategy firm located in Aptos, CA and Washington, D.C. | ||
[http://www.terraeclipse.com](http://www.terraeclipse.com) | ||
- - - | ||
### License: MIT | ||
Copyright (C) 2012 Terra Eclipse, Inc. ([http://www.terraeclipse.com](http://www.terraeclipse.com)) | ||
License: MIT | ||
------------ | ||
Copyright (C) 2012 Terra Eclipse, Inc. | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
@@ -165,0 +164,0 @@ of this software and associated documentation files (the "Software"), to deal |
@@ -134,2 +134,20 @@ var eventflow = require('../'), | ||
}); | ||
it ('should be able to be run multiple times', function (done) { | ||
emitter.on('numbers', function () { | ||
return 1; | ||
}); | ||
emitter.on('numbers', function() { | ||
return 2; | ||
}); | ||
emitter.parallel('numbers', function (err, results) { | ||
assert.ifError(err); | ||
assert(results[1], 2); | ||
emitter.parallel('numbers', function (err, results) { | ||
assert.ifError(err); | ||
assert(results[0], 1); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
@@ -151,3 +169,3 @@ | ||
it('should cause an error if there are more than one listeners', function (done) { | ||
it('should cause an error if there is more than one listener', function (done) { | ||
emitter.on('timestamp', function () { | ||
@@ -210,3 +228,18 @@ return new Date().getTime(); | ||
}); | ||
it('should be able to be called multiple times', function (done) { | ||
emitter.on('echo', function (msg) { | ||
return msg; | ||
}); | ||
emitter.invoke('echo', 'hello', function (err, value) { | ||
assert.ifError(err); | ||
assert(value, 'hello'); | ||
emitter.invoke('echo', 'world', function (err, value) { | ||
assert.ifError(err); | ||
assert(value, 'world'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
13722
270
178