This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-22
Channels
- # aws (12)
- # babashka (24)
- # beginners (51)
- # biff (2)
- # cherry (4)
- # cider (2)
- # clj-kondo (4)
- # cljs-dev (19)
- # clojure (70)
- # clojure-australia (4)
- # clojure-europe (39)
- # clojure-nl (4)
- # clojure-norway (6)
- # clojure-spec (9)
- # clojurescript (21)
- # component (6)
- # cursive (18)
- # data-science (9)
- # datomic (18)
- # events (2)
- # expound (4)
- # fulcro (15)
- # graalvm (2)
- # graphql (5)
- # jobs (1)
- # juxt (2)
- # leiningen (8)
- # malli (4)
- # meander (21)
- # nrepl (3)
- # observability (14)
- # off-topic (49)
- # other-languages (1)
- # pathom (13)
- # pedestal (7)
- # rdf (5)
- # re-frame (10)
- # reitit (1)
- # sql (4)
- # squint (30)
- # tools-deps (1)
- # vim (11)
hello all, I have one interceptor that I want not turn on in production, is there any way to do that?
Wrap registering such an interceptor in (when re-frame.interop/debug-enabled? ...)
. Of course, :require
that namespace explicitly.
I used this
(when (= js/goog.DEBUG true)
(rf/reg-global-interceptor schema-check-interceptor))
(= ... true)
is superfluous.
But also, I'd use re-frame.interop
still, because it marks that boolean in a special way. Maybe it's not necessary nowadays though, I haven't checked.
Re-frame conceptual question! I have an event that creates an entity and an event handler that persists the entity to the backend. I have another event that “modifies” the entity and persists that to the backend. I want to allow user to do these in one click. I can make a third event handler that dispatches both events, but how do I ensure that the side effects happen in order, i.e. that my INSERT from no. 1 is finished in time for the UPDATE from no. 2?
Prefer function composition to event composition. If you can't do it directly, then extract relevant functionality from event handlers and compose the resulting functions.
But if you must issue two separate requests for insert and update, just issue the update event as the :on-success
event handler of the insert event.
I’m in the your-second-paragraph case. So the :on-success
event handler would have to update the db with the returned id of the new entity, and declare the update effect