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

Function onDestroy

packages/svelte/src/index-client.js:115–121  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

113 * @returns {void}
114 */
115export function onDestroy(fn) {
116 if (component_context === null) {
117 e.lifecycle_outside_component('onDestroy');
118 }
119
120 onMount(() => () => untrack(fn));
121}
122
123/**
124 * @template [T=any]

Callers

nothing calls this directly

Calls 2

untrackFunction · 0.90
onMountFunction · 0.85

Tested by

no test coverage detected