Last active
November 15, 2020 14:18
-
-
Save ashwinkumar2438/48a2430470f2b9ac02b7fbdd5c8f0c41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
emit(eventname,...args){ | |
if(!this.hasOwnProperty(eventname))return false; | |
if(Array.isArray(this[eventname])){ | |
this[eventname].forEach(callback=>callback(...args)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment