This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-14
Channels
- # announcements (7)
- # babashka (13)
- # beginners (98)
- # biff (20)
- # calva (3)
- # clj-kondo (5)
- # clj-otel (6)
- # cljs-dev (96)
- # clojure (22)
- # clojure-austin (30)
- # clojure-conj (4)
- # clojure-europe (53)
- # clojure-nl (2)
- # clojure-norway (63)
- # clojure-uk (3)
- # clojurescript (18)
- # cursive (10)
- # data-science (11)
- # datalevin (2)
- # datomic (7)
- # deps-new (1)
- # fulcro (3)
- # graphql (1)
- # gratitude (4)
- # hyperfiddle (43)
- # kaocha (4)
- # malli (15)
- # pathom (6)
- # polylith (2)
- # reagent (3)
- # reitit (2)
- # releases (6)
- # remote-jobs (1)
- # rewrite-clj (45)
- # ring (4)
- # shadow-cljs (47)
- # sql (5)
- # xtdb (8)
It turns out my earlier statement about :on-coercion-error
was wrong. Upon closer inspection of source code, it’s indeed possible to pass this option to reitit.frontend.easy/start!
, but now I’m stuck trying to navigate to an error page when a coercion error happens.
The coercion error handler is given a match
and error
object, but (r.f.e/replace-state ::error-route nil nil)
doesn’t have any effect, and I notice that the atom r.f.e/history
contains a null value.
Any tips for achieving what I want?
OK so I have made two observations:
• when the coercion error happens on router initialization, there is no Html5History object yet, so on-coercion-error
cannot just call r.f.e/replace-state
• we can manually (.replaceState js/window.history …)
then re-attempt initialization when the above happens
My solution feels more like a hack, however. If there is a better way, please let me know