MCPcopy
hub / github.com/sveltejs/svelte / teardown

Function teardown

packages/svelte/src/internal/client/reactivity/effects.js:192–197  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

190 * @param {() => void} fn
191 */
192export function teardown(fn) {
193 const effect = create_effect(RENDER_EFFECT, null);
194 set_signal_status(effect, CLEAN);
195 effect.teardown = fn;
196 return effect;
197}
198
199/**
200 * Internal representation of `$effect(...)`

Callers 5

fromActionFunction · 0.90
eagerFunction · 0.90
cleanupFunction · 0.90
async_derivedFunction · 0.90
test.tsFile · 0.50

Calls 2

set_signal_statusFunction · 0.90
create_effectFunction · 0.85

Tested by

no test coverage detected