MCPcopy
hub / github.com/vuejs/core / onScopeDispose

Function onScopeDispose

packages/reactivity/src/effectScope.ts:223–232  ·  view source on GitHub ↗
(fn: () => void, failSilently = false)

Source from the content-addressed store, hash-verified

221 * @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose}
222 */
223export function onScopeDispose(fn: () => void, failSilently = false): void {
224 if (activeEffectScope) {
225 activeEffectScope.cleanups.push(fn)
226 } else if (__DEV__ && !failSilently) {
227 warn(
228 `onScopeDispose() is called when there is no active effect scope` +
229 ` to be associated with.`,
230 )
231 }
232}

Callers 3

createdFunction · 0.90
setupFunction · 0.85

Calls 2

warnFunction · 0.90
pushMethod · 0.65

Tested by 2

createdFunction · 0.72
setupFunction · 0.68