Given a subscription with a subscribing input function, what is the idiomatic way of making db available to the calculation function? E.g.:
(rf/reg-sub
user-job
(`*fn* [db [_ user-id]]`
(get-in db [:users user-id :job])))
(rf/reg-sub
user-job-title
(`*fn* [[ user-id] ]`
(rf/subscribe [user-job user-id]))
(`*fn* [job _]`
;; How do I avail db?
(get-in db [:jobs job :title])))
By using reg-sub-raw.
You could create a subscription for jobs, and then pull that in in the signals function.
(rf/reg-sub
::user-job
(fn [db [_ user-id]]
(get-in db [:users user-id :job])))
(rf/reg-sub ::jobs :-> :jobs)
(rf/reg-sub
::user-job-title
(fn [[_ user-id]]
[(rf/subscribe [::user-job user-id]) (rf/subscribe [::jobs])])
(fn [[job jobs] _]
(get-in jobs [job :title])))