computed
computed(compute, options?) returns a readonly Signal.
It evaluates lazily, caches its value, and replaces its synchronous dependency
edges after each successful evaluation. Equality defaults to Object.is.
Computed functions cannot write signals, including equality no-ops, and cycles are rejected with a diagnostic.
See the signals and scheduling contract.
Related types: Signal,
SignalOptions.
API details from source
Section titled “API details from source”
Creates a lazy, cached readonly signal whose dependencies are tracked during evaluation.
computed: <T>(compute: () => T, options?: SignalOptions<T>) => Signal<T>Related API: computed, SignalOptions, Signal.
Parameters
Section titled “Parameters”-
compute— Synchronous calculation whose signal reads become dependencies. -
options— Equality comparison and optional diagnostic name. See SignalOptions.
Returns
Section titled “Returns”A readonly, lazy, cached signal that recomputes when its dependencies change. See Signal .
See also
Section titled “See also”View source — packages/core/src/lib/signals/graph.ts:673
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Authoring, signals, and lifecycle companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Read and update signals: Use writable, readonly, and computed values with synchronous batching. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.