Reactive context; defaults to the shared global context.
Function that reads reactive properties and optionally returns a value.
Optionalsetter: (value: any) => void
Optional callback that receives the return value of getter, or its resolved value when getter returns a promise.
A disposal function that unsubscribes the effect from all tracked properties.
Creates a reactive effect that re-runs whenever tracked properties change.
The
getterfunction is executed immediately. Any property read on a signal during this execution is subscribed to the effect. When a subscribed property is written, the effect is scheduled to re-run (debounced viasetTimeout 0).An optional
setterreceives the return value ofgetter. When the getter returns aPromise,setteris called with its resolved value.The context is determined by
this, following the same rules as signal.