Created
September 4, 2017 05:58
-
-
Save itsdouges/32106d5ac01332a8d73f33cee47e6ac3 to your computer and use it in GitHub Desktop.
Wrapper around addEventListener/removeEventListener
This file contains 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
export function addEvent (event: string, cb: Function) { | |
window.addEventListener(event, cb, false); | |
return () => window.removeEventListener(event, cb, false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment