add setHash helper

This commit is contained in:
Kyle Shockey
2017-07-14 00:08:47 -07:00
parent 617cf7c867
commit d7f6355d85
2 changed files with 12 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
export const setHash = (value) => {
if(value) {
return history.pushState(null, null, `#${value}`)
} else {
return window.location.hash = ""
}
}