2 ms·
Hm, really? Maybe you're missing a layer of indirection if that's so? Usually I end up wrapping things myself so I have one "setup-handler :name" function/macr
by capableweb 7y ago
Hm, really? Maybe you're missing a layer of indirection if that's so?
Usually I end up wrapping things myself so I have one "setup-handler :name" function/macro that creates the subscription and event db handler for me. There are also existing libraries that does this for you, if writing it yourself is not wanted.
One example of such library: https://gitlab.com/nikperic/reframe-utils https://gitlab.com/nikperic/reframe-utils
`reg-basic-sub` has this outcome:
(reg-basic-sub :common/active-page)
;; Equivalent to
(reg-basic-sub :common/active-page :common/active-page)
;; Equivalent to
(reg-sub
:common/active-page
(fn [db _]
(:common/active-page db)))