The callback that is invoked when deps change. The effect may return a destructor/cleanup callback.
The previous effect is cleaned up before executing the next one.
Optionaldeps: DependencyListThe list of dependencies. If undefined, the effect is executed on every render.
An analogue of
React.useEffectthat supports a Promise returned from the effect callback.The returned promise may resolve to a destructor/cleanup callback. The effect callback receives an AbortSignal that is aborted if the effect is re-run before the previously returned promise resolves. Cleanup callbacks returned from aborted effects are ignored.