The effect body to execute.
Optionaloptions: CreateEffectOptions<undefined>Optional effect behavior overrides.
An effect handle for manual disposal.
Creates an eager reactive effect.
The effect runs immediately once and then reruns synchronously whenever one of the dependencies read during its last execution changed.
The return value of each execution is passed into the next execution as context.previous. When options.initial is set, the first
execution receives that value instead of undefined.
context.onCleanup registers callbacks that run before the next execution and when the effect is disposed.
Effects return an explicit handle for manual disposal and additionally register their cleanup on the active scope, if there is one.
The effect body to execute.
Optional effect behavior overrides.
An effect handle for manual disposal.
Creates an eager reactive effect.
The effect runs immediately once and then reruns synchronously whenever one of the dependencies read during its last execution changed.
The return value of each execution is passed into the next execution as
context.previous. Whenoptions.initialis set, the first execution receives that value instead ofundefined.context.onCleanupregisters callbacks that run before the next execution and when the effect is disposed.Effects return an explicit handle for manual disposal and additionally register their cleanup on the active scope, if there is one.