This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-15
Channels
- # beginners (97)
- # boot (54)
- # cider (13)
- # cljs-dev (3)
- # cljsrn (9)
- # clojure (64)
- # clojure-berlin (1)
- # clojure-brasil (119)
- # clojure-dev (3)
- # clojure-france (5)
- # clojure-greece (1)
- # clojure-italy (5)
- # clojure-madison (1)
- # clojure-russia (15)
- # clojure-spec (25)
- # clojure-uk (57)
- # clojurebridge (5)
- # clojurescript (45)
- # code-art (1)
- # community-development (17)
- # cursive (24)
- # datomic (83)
- # emacs (11)
- # fulcro (70)
- # hoplon (7)
- # immutant (3)
- # leiningen (19)
- # luminus (5)
- # lumo (25)
- # onyx (123)
- # other-languages (7)
- # pedestal (2)
- # re-frame (12)
- # ring (15)
- # ring-swagger (51)
- # shadow-cljs (89)
- # spacemacs (23)
- # sql (4)
- # unrepl (57)
- # utah-clojurians (1)
- # vim (1)
Zimpler " Reagent and re-frame are just really nice to work with, enabling to express complex logic in a very simple way" https://clojure.org/stories/zimpler
Hi, if I have a :db
key and a :dispatch
key in a reg-event-fx
, what is the order of :db
and :dispatch
being applied? Is it guaranteed that the effect of :db
comes before :dispatch
take place, or the order is not defined?
You can not assume the :dispatch
effect will occur after the db
is updated. However, since event handling is async you can trust that the :db
effect will update the db
before the event handler that was dispatched will run.
I found the answer in Effects.md
.
### Order Of Effects?
There isn't one.
`do-fx` does not currently provide you with control over the order in
which side effects occur. The `:db` side effect
might happen before `:dispatch`, or not. You can't rely on it.
@cmal, what I do is to pass the (relevant part of the) state to the effect
@pesterhazy to :effects
?
nevermind , I will write this down and when another day I have a problem on this I will dive into it again. I have already rewrite my app, and now there is no need for an ordered :db
and :dispatch
.