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

Function onEffectCleanup

packages/reactivity/src/effect.ts:558–567  ·  view source on GitHub ↗
(fn: () => void, failSilently = false)

Source from the content-addressed store, hash-verified

556 * an active effect.
557 */
558export function onEffectCleanup(fn: () => void, failSilently = false): void {
559 if (activeSub instanceof ReactiveEffect) {
560 activeSub.cleanup = fn
561 } else if (__DEV__ && !failSilently) {
562 warn(
563 `onEffectCleanup() was called when there was no active effect` +
564 ` to associate with.`,
565 )
566 }
567}
568
569function cleanupEffect(e: ReactiveEffect) {
570 const { cleanup } = e

Callers 1

effect.spec.tsFile · 0.90

Calls 1

warnFunction · 0.90

Tested by

no test coverage detected