Fork me on GitHub

@mattly 2 things: 1. Subscriptions are cached, and multiple calls for a sub with the same params will return the same Reaction instance. They are disposed of when they are no longer referenced, so if Reagent doesn't see the sub being used, it will dispose of it. 2. Make sure that your subscription isn't pulling directly off the root, otherwise Reagent will see the panel change in app-db as a change that needs to cause the subscription to rerun (even though the keys used by that subscription haven't changed)


@mattly to follow on from Daniel's point ... be sure to use the 4 layer model to avoid unnecessary re-computation (layer 2 is key in that):


aha, thanks


Had a question w.r.t. testing handlers. One approach I didn’t see mentioned in the docs is to have a config map of event-keywords to handler-fns. If you never use reg-sub etc outside of a couple of side-effectful start/stop fns that take a config and do registration, you should be able to specify exactly which handlers run just by selecting keys in the config, or updating it to inject mocks/stubs. Has anyone tried that? Are there any issues I’m missing here?