
Dev finally makes the graph 'actually move' with effects: after endless diagrams and symbol registries, signals notify—PMs can stop blaming stale UIs
In a recent development, a team of engineers has implemented a functional Effect core, enabling the creation of a reactive graph that automatically tracks dependencies. The Effect core is built on top of a Signal core, which supports subscriptions, and introduces the concept of effects that can re-run when dependencies change. The implementation utilizes a Symbol-based registry to maintain the relationship between nodes and effect instances, allowing for efficient lookup and scheduling of effects. The createEffect function runs a given function inside a tracking scope, collecting dependencies and scheduling re-runs as needed. The signal.set function notifies dependent effects and re-runs them via microtask batching, ensuring that multiple set calls in the same tick only re-run the effect once. This development has significant implications for the industry, enabling the creation of more efficient and scalable reactive systems. The team plans to explore alternative implementations, including a WeakMap-based registry, in future articles.