#re-frame moving towards Cells? https://day8.github.io/re-frame/Flows/
tl;dr: flows are derived values that live in app-db. This solved the problem of accessing a subscription outside a view function, for one. Make it a flow instead of a subscription.
I always thought they did (live in app-db), but this explains why a subscription/derivation can access only subscriptions, never app-db itself. I always wondered about that.
Nice example:
{:id :room-area
:inputs {:w [:room :width]
:h [:room :length]}
:output (fn calc-area [previous-area {:keys [w h] :as inputs}]
(* w h))
:path [:room :area]}
Thoughts:
• do I detect a modest amount of boilerplate? 🙀
• as with normal #re-frame subscriptions, I do not see a way for a conditional dependency/input to be skipped based on other inputs;
• great seeing the previous-area parameter to a formula. Matrix formula macros inject _cache for that; and
• can a path include a value, such as room-id? Or must paths be fully hardcoded?
🤔