Fork me on GitHub
#re-frame
<
2021-11-08
>
lassemaatta07:11:18

is it ok these days to say @(rf/subscribe [ ... within the computation-fn of a reg-sub call? I think I saw a PR or a discussion somewhere saying this is ok now, but perhaps I'm mistaken

p-himik07:11:18

It is OK. But just in case - consider if reg-sub-raw is better suited for your use-case. Especially if @(rf/subscribe ...) is the return statement or if you don't use either the db argument or any signal subscription.

👍 1
Gerome19:11:57

Hi! I have a thread where I use map but at the end I need side effects. I'm solving this using doall, like this: (-> event .-result .-target some-transforms (->> (map more-transformations) (map dispatch-wrapper) doall)) . While this works, it feels wrong. I will dispatch the entire list and handle it in the event handler. Would this be a good solution to realize the seq for side effects once all transformations are in place?

Lu20:11:00

doseq for side effects .. also don't nest -> and ->>, as it becomes hard to read. Do all your transformations first and bind the result to a symbol in a let and then use doseq to run all side effects

👍 1
p-himik20:11:28

And yes, do move all such logic into an event handler - it felt wrong to you for a good reason.

Gerome07:11:13

Thanks for the help. It looks much better now.