···11+// Record history depth at app entry so we can detect deep-links.
22+// Since this module is loaded once per page lifecycle (hash routing never
33+// reloads the page), this value is stable for the entire session.
44+const _entryDepth = history.length
55+66+export function goBack() {
77+ if (history.length > _entryDepth) {
88+ history.back()
99+ } else {
1010+ location.hash = '#!/'
1111+ }
1212+}