Creates a reactive effect that automatically re-runs when its tracked signals update.
The return type of the effect function (typically void).
A function that will run whenever its tracked signals change.
A stop function to cancel the effect.
const count = createSignal(1);const stopEffect = createEffect(() => { console.log('Count is', count());});// To stop the effect:stopEffect(); Copy
const count = createSignal(1);const stopEffect = createEffect(() => { console.log('Count is', count());});// To stop the effect:stopEffect();
Creates a reactive effect that automatically re-runs when its tracked signals update.