Permalink
Browse files

[dist] version bump

  • Loading branch information...
2 parents 342bacc + af90b34 commit dcb9b5cb52e7b479b0adabbae7678d449c740865 @0x00A committed Mar 18, 2013
Showing with 6 additions and 10 deletions.
  1. +2 −3 README.md
  2. +4 −7 lib/eventvat.js
View
@@ -21,13 +21,12 @@ $npm install eventvat
Each new instance of `EventVat` is a hash. There are lots of convenient methods attached to each new instance.
## events
-EventVat uses <a href="https://github.com/hij1nx/EventEmitter2">EventEmitter</a>. Listeners can attached to an EventVat object. An EventVat object can emit and event and a listener will respond. An event has three characteristics, the event name, a listener and an associated data key or wildcard.
+EventVat uses <a href="https://github.com/hij1nx/EventEmitter2">EventEmitter2</a>. Listeners can attached to an EventVat object. An EventVat object can emit and event and a listener will respond. An event has three characteristics, the event name, a listener and an associated data key or wildcard.
```javascript
var vat = EventVat();
- vat.on('get foo', function(key, value)
-
+ vat.on('get foo', function(key, value) {
console.log('`' + key + '` has the value: `' + value + '`');
});
View
@@ -9,13 +9,6 @@
}
}
- function init() {
- this._events = new Object;
- }
-
- this.wildcard = ' ';
- this.listenerTree = new Object;
-
//
// Determine if a key exists within an object
//
@@ -153,6 +146,10 @@
return Object.keys(this.hash).length;
}
+ if(typeof regex === 'string') {
+ regex = new RegExp(regex);
+ }
+
for(var k in this.hash) {
if(has(this.hash, k) && regex.test(k)) {
keys.push(k);

0 comments on commit dcb9b5c

Please sign in to comment.