Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

implemented .reset()

  • Loading branch information...
commit c623c73613fe4bc1fb15ce3fd29843afbeb1375b 1 parent 7e492c5
@substack authored
Showing with 10 additions and 1 deletion.
  1. +9 −0 index.js
  2. +1 −1  package.json
View
9 index.js
@@ -13,6 +13,15 @@ function OrderedEmitter (opts) {
}
OrderedEmitter.prototype = new EventEmitter;
+OrderedEmitter.prototype.reset = function (evName) {
+ if (evName === undefined) {
+ this._next = {};
+ }
+ else {
+ this._next[evName] = 0;
+ }
+};
+
OrderedEmitter.prototype.emit = function (evName, obj) {
var emit = function (args) {
EventEmitter.prototype.emit.apply(this, args);
View
2  package.json
@@ -1,6 +1,6 @@
{
"name" : "ordered-emitter",
- "version" : "0.0.2",
+ "version" : "0.1.0",
"description" : "emit events in order",
"main" : "index.js",
"directories" : {
Please sign in to comment.
Something went wrong with that request. Please try again.