@nodeart/observable
v1.0.15
Published
Simple Observable pattern
Downloads
19
Readme
DEPRECATED
Please, use https://www.npmjs.com/package/@nodeart/event_emitter instead.
Methods:
observable.on(eventName, ...fns)
observable.once(eventName, ...fns)
observable.unbind(eventName, ...fns)
observable.unbindAll()
// One can remove some functions from listeners array,
// but to remove all listeners (read 'remove event'), one can pass
// only eventName to .unbind method
observable.emit(eventName, ...args)
Features:
- any number of functions can be put as listeners
- chaining available
- written with ES6 syntax
- can be used in node.js and in browser