var event = new EventEmitter();
event.on( 'login', function ( data ) {
console.log( data )
} );
event.once( 'logout', function ( data ) {
console.log( data )
} ).emit( 'login', {
uid: 123,
login: true
} ).emit( 'login', {
uid: 234,
login: true
} ).emit( 'logout', {
uid: 123,
login: false
} ).emit( 'logout', {
uid: 123,
login: false
} ).clear();
console.log( event )
-
Notifications
You must be signed in to change notification settings - Fork 0
一个简单的 EventEmitter,帮助你实现事件的订阅和发布。
929467350/EventEmitter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
一个简单的 EventEmitter,帮助你实现事件的订阅和发布。
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published