1.0.0 • Published 5 years ago
@hellomonday/emitter v1.0.0
@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