Fork me on GitHub
#re-frame
<
2022-03-05
>
mauricio.szabo04:03:40

Hi there! I'm trying to use re-frame in a different type of project, and I want to subscribe to a change in the app-db, but outside a render/reagent component. Is it possible?

lilactown05:03:04

it is possible, but it can be easy to create a memory leak if you don't eventually clean up the subscription

p-himik10:03:10

You also write "to a change" - note that using a subscription outside of a reactive context will not magically re-run the surrounding code. A reactive context is a view or a reaction or a similar thing that ends up being used in a view.