This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-28
Channels
- # babashka (10)
- # beginners (140)
- # cider (6)
- # clj-kondo (10)
- # cljs-dev (39)
- # cljsrn (6)
- # clojars (1)
- # clojure (23)
- # clojure-europe (2)
- # clojure-spec (7)
- # clojure-uk (6)
- # clojurescript (1)
- # conjure (16)
- # cursive (3)
- # datomic (3)
- # emacs (6)
- # fulcro (13)
- # graalvm (3)
- # malli (8)
- # meander (4)
- # off-topic (43)
- # pathom (1)
- # pedestal (15)
- # re-frame (13)
- # reagent (3)
- # sci (25)
- # shadow-cljs (26)
- # sql (9)
- # testing (34)
- # tools-deps (80)
I was reading the effects doc and I have a question with regard to :
(reg-event-fx ;; -fx registration, not -db registration
:my-event
(fn [cofx [_ a]] ;; 1st argument is coeffects, instead of db
{:db (assoc (:db cofx) :flag a)
:dispatch [:do-something-else 3]}))
Is there a way to dispatch more than one event with the :dispatch key? If not, is it because this use case should never be used and should I use a different logic?@rnait1977 there is an effect called :`dispatch-n`
In that case, is the cofx passed to these :dispatch-n or :dispatch events the same as the original cofx of the reg-event-fx or the one that has been modified by the :db key?
is there a list of built-in effect handlers? like the ones that deal with :dispatch and dispatch-n
There doesn't seem to be one. There's this section http://day8.github.io/re-frame/Effects/#existing-effect-handlers that has to links, but neither of them shows anything useful.
But it's pretty easy to search for the usages of reg-fx
in the re-frame source code.
so i figure this is all then https://github.com/day8/re-frame/blob/master/src/re_frame/fx.cljc
Yeah, in the recent docs upgrade, the list of buildin effect handlers was removed.
Newly refined infographics on this page ... https://day8.github.io/re-frame/event-handling-infographic/
I'm interested in comments