This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-16
Channels
- # aws (17)
- # babashka (2)
- # beginners (131)
- # bristol-clojurians (1)
- # calva (16)
- # chlorine-clover (6)
- # cider (10)
- # clara (5)
- # cljsrn (82)
- # clojure (176)
- # clojure-dev (14)
- # clojure-europe (13)
- # clojure-italy (13)
- # clojure-nl (4)
- # clojure-spec (10)
- # clojure-sweden (32)
- # clojure-uk (32)
- # clojuredesign-podcast (2)
- # clojurescript (34)
- # community-development (2)
- # conjure (17)
- # cursive (4)
- # datomic (51)
- # emacs (6)
- # figwheel-main (26)
- # fulcro (16)
- # graalvm (11)
- # jobs (2)
- # jobs-discuss (30)
- # kaocha (4)
- # meander (23)
- # off-topic (34)
- # pathom (5)
- # re-frame (10)
- # reagent (3)
- # reitit (6)
- # releases (3)
- # sci (36)
- # shadow-cljs (27)
- # sql (9)
- # testing (6)
- # tools-deps (28)
- # vim (8)
Is it good practice to use conditionals in effect-handlers? For Example: If a value is present in app-db, then emit one effects map and if not, do another?
You're mixing something up. Did you mean "event handlers" in the first sentence? If so, then it's a perfectly valid thing to do.
@U49RJG1L0 You'll often see code like this
(fn [db v]
(cond-> db
(some-condition? v) (assoc :something :to-add)
(another-predicate> db)) (update :key some-fn)))
^^^ the real lesson here is that cond->
can be useful
Another question: When I have a component called my-component
whats the difference between me calling it like a normal function (my-component)
and including it with the vector notation [my-comontent]
?
I'm guessing the function call has the downside of accidental execution, but I can't find any more info on this.