Type that represents a base signal object.
const count: SignalEntry<number> = makeSignal(0);const unsub = count.sub(() => console.log("count:", count.get()));count.set(1); // logs "count: 1"count.update(c => c+1); // logs "count: 2"unsub(); Copy
const count: SignalEntry<number> = makeSignal(0);const unsub = count.sub(() => console.log("count:", count.get()));count.set(1); // logs "count: 1"count.update(c => c+1); // logs "count: 2"unsub();
Retrieve the signal value.
Set the signal value.
Set the value using a pure updater based on the previous value.
Subscribe to change notifications. Returns an unsubscribe function.
Force a notification cycle without changing the value (useful after in-place mutation of structural data).
Description
Type that represents a base signal object.
Example