reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
worlds-endless 2020-03-13T15:02:58.065200Z

No one with suggestions for handling back-button confirmation?

juhoteperi 2020-03-13T16:05:42.066600Z

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]))

worlds-endless 2020-03-13T21:13:56.067200Z

This solution looks promising; however, since we're not using url-fragments, I need something other than location.hash, right?