0.1.2 • Published 2 years ago

@anco/eventemitter v0.1.2

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

@anco/EventEmitter

Build Status An event emitter implementation based on ts and build into es5.

Use Map to minify get time complexity.

How

import EventEmitter from '@anco/eventemitter';
// or
const EventEmitter = require('@anco/eventemitter').default;
const ee = new EventEmitter();
ee.on('sleep',function(...args){
    console.log('sleep triggered, args:', ...args);
})  

ee.emit('sleep','hello1','hello2');
ee.off('sleep');

Implements

  • on
  • off
  • emit
  • once
  • addListeners
  • mutiple callbacks
  • removeAllListeners

WIP

  • max listeners limitation
  • some fancy things
0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago