Runs a side-effect function immediately and re-runs it on a microtask whenever any reactive signals read during its evaluation change.
Supports returning a cleanup callback: () => void | (() => void). Returns an EffectSubscription with .dispose() and [Symbol.dispose]().
() => void | (() => void)
EffectSubscription
.dispose()
[Symbol.dispose]()
Runs a side-effect function immediately and re-runs it on a microtask whenever any reactive signals read during its evaluation change.
Supports returning a cleanup callback:
() => void | (() => void). Returns anEffectSubscriptionwith.dispose()and[Symbol.dispose]().