Last active
February 9, 2019 11:02
-
-
Save jeswin/876eadd02efa1509068f42f52c3fc25c to your computer and use it in GitHub Desktop.
router-article-click-handler
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
function createClickHandler(url) { | |
return ev => { | |
history.pushState({}, undefined, url); | |
storePathInState(url.split("/").slice(1)); | |
ev.preventDefault(); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment