This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-05
Channels
- # adventofcode (8)
- # aleph (42)
- # announcements (4)
- # beginners (157)
- # boot (4)
- # calva (1)
- # cider (6)
- # cljdoc (8)
- # cljs-dev (1)
- # cljsrn (3)
- # clojure (50)
- # clojure-europe (9)
- # clojure-italy (16)
- # clojure-nl (2)
- # clojure-russia (6)
- # clojure-spec (59)
- # clojure-uk (25)
- # clojurescript (20)
- # core-async (41)
- # cursive (30)
- # data-science (9)
- # datomic (20)
- # fulcro (28)
- # kaocha (9)
- # nrepl (1)
- # off-topic (3)
- # om (3)
- # pathom (10)
- # re-frame (8)
- # reagent (2)
- # ring-swagger (38)
- # rum (9)
- # shadow-cljs (209)
- # spacemacs (7)
- # tools-deps (11)
- # vim (6)
- # yada (2)
Not sure if itโs idiomatic, but I find it helpful reference a function from my event / subscription. It also makes it easier to test.
(defn event-name
"event-name's doc"
[{:keys [db]} _]
{:db db})
(re-frame/reg-event-fx :event-namespace/event-name event-name)
๐ 5
https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/subs.cljs#L90 in a layer 3 subscription, should i add a signal function
that returns the app db if i still need the db in my computation function
, or should i just use re-frame.db/app-db
directly?
It looks to me like the computation function is passed the result of the signal function
So you grab any data you need out of db in the signal, and it comes to computation as a parameter