This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
How can I use the second argument to a subscription handler in re-frame? (fn [db <what's this?>] ...)
When building reusable views, should I pass in subscriptions as arguments, or subscribe in the component?
And where should I deref the reactive subscription?
I.e.
(defn child-component [contacts]
[:div "Should I deref here?" @contacts])
(defn parent-component []
(let [contacts (subscribe [:contacts])
[:div "Where should I deref contacts?"
[child-component contacts]]))
or
(defn parent-component []
(let [contacts (subscribe [:contacts])
[:div "Where should I deref contacts?"
[child-component @my-data]]))