Signal Computed & Effects
Eliminate dependency arrays with automatic runtime tracking.
Computed & Effects
computed() derives a value from one or more base signals. It caches its output and only re-evaluates when its dependencies change, similar to useMemo.
effect() executes side effects automatically whenever any signal read inside its body updates, similar to useEffect.
No More Dependency Arrays
React hooks require you to explicitly declare what dependencies you are tracking in a [deps] array. If you make a mistake, you introduce stale closures or infinite loops.
Signals track dependencies dynamically at runtime. If you read a .value anywhere inside a computed or effect closure, the signal registers it as a subscriber automatically!
Lazy Evaluation
Unlike standard React renders, computed() signals evaluate lazily. They won't actually run their calculation until something (like an effect or a component) subscribes to them.
This means you can declare hundreds of complex computed derivations globally, and pay zero performance cost until they are actively rendered.
Concept Visual: Runtime Tracking
Watch how the Signals engine scans the code at runtime to automatically discover dependencies, eliminating the fragile React [deps] array.
Notice how the Signals block has no dependency array. The engine scans execution and automatically tracks what is read!
Check yourself
Pick an answer to lock it in, then read why. Getting one wrong is part of how it sticks.
Remember this
computed()derives and caches state lazily.effect()runs side effects reactively.- Signals eliminate dependency arrays entirely.
- Runtime dependency tracking prevents stale closures by default.
Done with this concept?
Mark it complete to track your progress. No login needed.