Created
February 19, 2017 23:01
-
-
Save basarat/fc0a701e8b634297ba52a42c19388f19 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
let listener = ()=>null | |
// Don't want to execute this line again | |
window.addEventListener("hashchange",()=>{ | |
listener(); | |
}); | |
// You can call this as many times as you want | |
export const onHashChange(_listener){ | |
listener = _listener; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment