top | item 41443941

(no title)

seumars | 1 year 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.

discuss

order

SkiFire13|1 year ago

Properly 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|1 year ago

Yeah this seems more like observables than signals. Which despite what you may hear on the interwebs are two different things.