What it is
A signal is a reactive primitive holding a value plus the list of consumers that depend on it. Reading a signal subscribes the current computation; writing it notifies subscribers. This enables fine grained updates without diffing a virtual tree.
The primitives
- Signal: a readable and writable reactive value.
- Computed: a derived signal that recalculates lazily when its sources change.
- Effect: runs a side effect and re runs when any read signal updates.
Why fine grained matters
In a virtual DOM model a state change re runs a component and diffs its output. With signals the dependency graph is known precisely, so a change propagates only to the exact effects and DOM bindings that read it. There is no component level re render.
- Dependencies are tracked at read time.
- Updates are pushed, then often glitch free via batching.
- The cost scales with what changed, not tree size.
Key idea
Signals track dependencies at read time so a write propagates only to the exact computeds and effects that use it, avoiding component wide re renders.