Fork me on GitHub

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


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

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?


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

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


Thanks for the help. It looks much better now.