event.es6
TypeScript icon, indicating that this package has built-in type declarations

1.3.5 • Public • Published

event.es6

A simple event lib for fire/emit and on/off (or subscribe/unsubscribe whatever you like 😁)

usage

import { Event } from 'event.es6';
const event = new Event();
 
event.on('say', function(what) {
  // or event.subscribe('say', function(what){...})
  console.log(what);
});
event.emit('say', 'nothing'); // or event.fire('say', 'nothing')
 
// remove event
event.off('say'); // or event.unsubscribe('say')

Readme

Keywords

Package Sidebar

Install

npm i event.es6

Weekly Downloads

40

Version

1.3.5

License

MIT

Unpacked Size

25.6 kB

Total Files

11

Last publish

Collaborators

  • suhaotian