(fn: () => void, failSilently = false)
| 221 | * @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose} |
| 222 | */ |
| 223 | export 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 | } |