Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
*/
115
export
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
untrack
Function · 0.90
onMount
Function · 0.85
Tested by
no test coverage detected