1.0.0 • Published 4 years ago

@hellomonday/emitter v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@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