Fork me on GitHub

Yeah exactly! We have generalized it into a pattern we call observers.


It's extremely useful given that you won't have to catch changes in the handler but instead you can just rely on re-frame doing it's magic


We did the syntax a little differently but same concept

Oliver George10:10:37

Out of curiosity, do you ever set your hair on fire with it? e.g. observer dispatches, event handler updates state, state change triggers same observer... rinse later repeat


Haha actually no, what triggers the observer is usually decoupled from what the observer does (eg. updated network state fetches data from API). We tend to observe mostly things like network state, db loaded, app in foreground etc and those we rarely update ourselves.

👍 4