Function
signal
Optional
Initial value stored by the signal.
The target to which the signal is bound.
The key path at which the signal will be stored in the target.
A reactive box for reading/updating the value.
Create a standalone reactive signal box. Returns a SignalBox wrapping the initial value.
const count = signal(0);const nested = signal(0, target, "users", "42", "score"); Copy
const count = signal(0);const nested = signal(0, target, "users", "42", "score");
Getter that returns the value.
Setter that changes the value and emits the signal.
Create a standalone reactive signal box that mirrors a getter and a setter. Returns a SignalBox wrapping the initial value.
const nested = signal(() => target.get("users", "42"), v => target.set(v, "users", "42"), target, "users", "42"); Copy
const nested = signal(() => target.get("users", "42"), v => target.set(v, "users", "42"), target, "users", "42");
Stage-3 decorator that turns a field, getter, setter, or accessor into a reactive signal.
class Counter { @signal count = 0; @effect log() { console.log(this.count); }}const c = new Counter();c.count++; // triggers effect, logs updated value Copy
class Counter { @signal count = 0; @effect log() { console.log(this.count); }}const c = new Counter();c.count++; // triggers effect, logs updated value
signal