Hello there, I’m staring at a re-frame codebase at the moment that has dozens and dozens of injected-subscriptions in various reg-event-fx
Would you consider this an anti-pattern? I can understand where the desire comes from: there’s already code massaging the app-db to deliver data in a specific form.
Repeating that in the event handler seems like a lot of code-duplication. The flip-side would be to add a battery of named fns that can also act as layer-3 subs and refer to those in an event handler.
How are you dealing with this?
> to add a battery of named fns that can also act as layer-3 subs and refer to those in an event handler Exactly this.
Not entirely related, but my app-db is split into two parts - domain data and app's state.
The latter I query with a bunch of get-in
calls, usually wrapped in appropriately named functions.
The former I query with a single function, because the data is normalized.
thank you