Last active
November 15, 2020 14:24
-
-
Save ashwinkumar2438/6847bb2e44f61d856dcecb6bfb176d33 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
{ | |
off(eventname,callback){ | |
if(!this.hasOwnProperty(eventname))return false; | |
if(!(callback && callback.constructor===Function))return false; | |
if(Array.isArray(this[eventname])){ | |
this[eventname]=this[eventname].filter(eventcb=>eventcb!==callback); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment