@hellomonday/emitter
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @hellomonday/emitter

Weekly Downloads

9

Version

1.0.0

License

MIT

Unpacked Size

4.73 kB

Total Files

5

Last publish

Collaborators

  • supermoos
  • zerguei
  • johnnyslack
  • virgilspruit
  • anderssjessen
  • terkelg