@hellomonday/emitter
v1.0.0
Published
Used to emit events
Downloads
43
Keywords
Readme
@hellomonday/emitter
A lightweight event dispatcher.
Install
$ npm install --save @hellomonday/emitter
Usage
import Emitter from '@hellomonday/emitter';
const emitter = new Emitter();
// listen to an event
emitter.on(EVENTS.scroll, this.onScroll);
// stop listening to an event
emitter.off(EVENTS.scroll, this.onScroll);
// emit an event
emitter.emit(EVENTS.scroll, {position: 100});
License
MIT © Hello Monday