Function
onEffectCleanup
(fn: () => void, failSilently = false)
Source from the content-addressed store, hash-verified
| 556 | * an active effect. |
| 557 | */ |
| 558 | export 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 | |
| 569 | function cleanupEffect(e: ReactiveEffect) { |
| 570 | const { cleanup } = e |
Tested by
no test coverage detected