0.0.1 • Published 5 years ago

yeventemitter v0.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

install


@npm: npm install YEventEmitter -S

@yarn: yarn add YEventEmitter

Quick


import YEventEmitter from 'YEventEmitter';

const yEventEmitter = new YEventEmitter();

yEventEmitter.on('start', (...args) => {
  console.log('start', ...args);
});

yEventEmitter.once('once', (...args) => {
  console.log('once', ...args);
});

yEventEmitter.emit('start', 'hello', 'world');
yEventEmitter.emit('once', 'hello', 'world');

yEventEmitter.off('start');
0.0.1

5 years ago