- Notifications
You must be signed in to change notification settings - Fork109
🔫 onfire.js is a nano version (~500b) for event-emitter.
License
NotificationsYou must be signed in to change notification settings
hustcc/onfire.js
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
nano version (~ 500b) for event-emitter.
npm i --save onfire.js
importEEfrom'onfire.js';constee=newEE();ee.on('mouseover',()=>{});ee.once('click',()=>{});ee.fire('click',1,'hello',true);ee.off('click');
Simple and similar withevent-emitter.
on(eventName: string, callback: Function): listen an event.once(eventName: string, callback: Function): listen a event only once.fire(eventName: string, ...parameters: any[]): emit / trigger an event with parameters.off(eventName?: string, callback?: Function): unsubscribe an event.
- Events subscribe and dispatcher.
Cross-component communicationfor React / Vue / Angular.- System event mechanism.
MIT@hustcc.
About
🔫 onfire.js is a nano version (~500b) for event-emitter.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.