Fork me on GitHub

@vikeri At its core, re-frame is event driven. When an event happens, it is processed by event handlers. Later, there is a reactive process by which the UI is updated. It sounds to me like you want to use the reactive process (subscriptions) to do something imperative? Or maybe a further dispatch. Have I understood?


Are you seeking to know when X happens so you can then do Y. Is it like that?


@mikethompson That is correct! I want to schedule a notification based on the updated reaction. I could add a listener to the re-frame event, but then I’d have to redo all the logic that is now in my subscription handlers, it would be much easier to just monitor my subscriptions with add-watch. It’s just funny that add-watch works as intended if I’m also referring to the same subscription in a component.


Apparently reagent.core/track! was the solution 🎉


@vikeri Cool, how did you end up using it?


@curlyfry Super simple, just wrote a function observer-fn that dereffed a subscription and then (r/track! observer-fn). Then each time the subscription updates the function will be rerun. B-E-A-utiful