4 ms·
Isn't this just an implementation of the Observable pattern? IIRC the difference between observables and signals is that signals don't recompute the value unles
by seumars 2y ago
Isn't this just an implementation of the Observable pattern? IIRC the difference between observables and signals is that signals don't recompute the value unless any of its sources change, by using a dependency graph. Also, .effect() is just what used to be called .subscribe() in knockout.js and others.
- SkiFire13 2y agoProperly implemented signals are more complex than the observer pattern, since they have to prevent duplicating updates if more than one dependency changes. They also fundamentally change the way you use them compared to observers, thanks to automatically subscribing to updates to their dependencies and propagating the updates to the dependents. Effects resembles observers, but you would generally avoid them when using signals unless necessary.
- fabiospampinato 2y agoYeah this seems more like observables than signals. Which despite what you may hear on the interwebs are two different things.