1.0.4 • Published 5 years ago

@c_kai/event v1.0.4

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

event

绑定事件,同步|异步触发事件

example

let Event = require('event');
let myEvent = new Event();

myEvent.on('say', async () => {
    await timeout(100)
});
myEvent.on('say', ()=>{
    console.log('hello')
});

// 异步触发
myEvent.emit('say');

// 按照监听器注册的顺序触发
myEvent.emitSync('say');
1.0.4

5 years ago

1.0.2

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago