3 ms·
It's basically a syntactic sugar on an Observer pattern but I like it. You would need a way to turn off 'when' observers. And I suppose it does couple the obser
by squeaky-clean 3y ago
It's basically a syntactic sugar on an Observer pattern but I like it. You would need a way to turn off 'when' observers. And I suppose it does couple the observer to the observable pretty tightly.
- SamBam 3y agoIt's pretty easy to turn off the when observers, simply `delete when`. Side-effect is that it will delete all the whens, so only use it if you need it!
- pmontra 3y agoDelete the observed variable? About coupling, an implementation could send state change events to a message bus and observers could subscribe only the events they care about.