glob-events
Advanced tools
Comparing version 0.4.1 to 0.5.0
# Changes | ||
## 0.5.0 | ||
- Expose iterator used to retrieve listeners | ||
## 0.4.1 | ||
@@ -4,0 +8,0 @@ |
@@ -114,2 +114,10 @@ /* | ||
listeners: function (name, opts) { | ||
var i = this.iterator(name, opts), f, a = []; | ||
while ((f = i.next()) !== undefined) { | ||
a.push(f._once || f); | ||
} | ||
return a; | ||
}, | ||
iterator: function (name, opts) { | ||
if (typeof name === 'object') { | ||
@@ -119,7 +127,3 @@ opts = name; | ||
} | ||
var i = this._store.iterator(name, options(opts)), f, a = []; | ||
while ((f = i.next()) !== undefined) { | ||
a.push(typeof f._once === 'function' ? f._once : f); | ||
} | ||
return a; | ||
return this._store.iterator(name, options(opts)); | ||
} | ||
@@ -126,0 +130,0 @@ |
{ | ||
"name" : "glob-events", | ||
"version" : "0.4.1", | ||
"version" : "0.5.0", | ||
"description" : "Event emitter with glob support on event names", | ||
@@ -13,5 +13,5 @@ "keywords" : ["event", "emitter", "glob", "listener"], | ||
"scripts" : { | ||
"start" : "mochify --watch --node", | ||
"start" : "mocha --watch", | ||
"lint" : "jslint --color './**/*.js'", | ||
"test-wd" : "mochify --wd", | ||
"wd" : "mochify --wd", | ||
"test" : "npm run lint && mocha && mochify --cover" | ||
@@ -18,0 +18,0 @@ }, |
@@ -47,2 +47,5 @@ # glob-events.js [](http://travis-ci.org/mantoni/glob-events.js) | ||
described in the [glob-tree match expressions][]. | ||
- `iterator([event][, options])`: Exposes the iterator used to retrieve all | ||
listeners, or all listeners for a given event. Note: When using `once`, the | ||
function returned by the iterator is not the same as the registered function. | ||
@@ -49,0 +52,0 @@ ### Options |
8205
116
78