api
docs
env
git
hbs
html
husky
jest
lintstaged
lisp
node
prettier
python
react
readme
schema
style
vue
web
$ tmpl util history
Adds history util.
Files
project
└─src
└──utils
└───history.js
↑ history.js
export const setPageInCurrentHistoryState = page => {window.history.replaceState({ page }, page);};export const pushPageToBrowserHistory = page => {window.history.pushState({ page }, page);};export const onHistoryPopGetPage = cb => {window.onpopstate = event => {cb(event.state);};};