(hash, replace, noConfirm)
| 38 | addEventListener('hashchange', () => updateRoute(), false); |
| 39 | |
| 40 | export function setRoute(hash, replace, noConfirm) { |
| 41 | let hashString = `${hash}`; |
| 42 | if (hashString[0] !== '#') hashString = `#${hashString}`; |
| 43 | if (replace) { |
| 44 | window.history.replaceState('', null, hashString); |
| 45 | } else { |
| 46 | stack.push(Object.assign({}, route)); |
| 47 | window.history.pushState('', null, hashString); |
| 48 | } |
| 49 | updateRoute(noConfirm); |
| 50 | } |
| 51 | |
| 52 | export function getUnloadSentry(onConfirm, onCancel) { |
| 53 | async function confirmPopState(hash) { |
no test coverage detected