1.2.3 • Published 5 years ago
birch-event-emitter v1.2.3
birch-event-emitter
A simpler event emitter for the browser
Features include:
- Event subscriptions return a
Disposableobject withdispose()method to unsubscribe from event. - Group event subscriptions using
DisposablesCompositeand dispose them all with one call, i.eDisposableComposite#dispose() - Listeners voice matters!! You can now dispatch an event using
EventEmitter#emithWithReturnwhere each listener's return value can be accessed from returned array.
Motivation
Forked from Notificar
- Included as a core dependency of
react-birchdirectly in the mono repository - Replaces functionality used in some of the original
tiny-emitterin thereact-aspendependencies to avoid unnecessary inclusion of duplicate functionality implemented in different ways - Transpiled to typescript
- Standard to standard verbs
on,emitinstead ofadd,dispatch
License
MIT