Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdavies committed Jun 24, 2016
1 parent 1eda5b3 commit 883d084
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions readme.md
Expand Up @@ -65,6 +65,35 @@ You can register for multiple events at once like this:
e.off('event1 event2 etc', myHandler);
```

Stopping propagation isn't build into Eev. If enough people ask for it, I'll bake it in. Meanwile, you can work around this limitation by doing something like this:

```js

;(function () {
var superOn = Eev.prototype.on;

Eev.prototype.on = function (names, fn) {
superOn.call(this, names, function (data) {
if (!data.isCanceled) {
return fn(data);
}
});
};

}());

```

With the above patch in place, you can do something like this in your event handlers:

```js
e.on('some-event', function foo (data) {
data.isCanceled = true; // Now, no downstream handlers should be invoked
})
```



## Installation

Just download eev.min.js, or use bower:
Expand Down

0 comments on commit 883d084

Please sign in to comment.