No one with suggestions for handling back-button confirmation?
I don't think there is any great solution, but I've worked around this a few times. I've just called confirm
on onhashchange, and then set location.hash
back to the previous value if needed. Something like:
(if (and before-change-message (not (js/confirm before-change-message)))
(if-let [p @previous-hash]
(set! js/location.hash p))
(dispatch [(keyword "frontend.routes" (name id)) route-data]))
This solution looks promising; however, since we're not using url-fragments, I need something other than location.hash, right?