(fn: () => void)
| 98 | } |
| 99 | |
| 100 | export function onScopeDispose(fn: () => void) { |
| 101 | if (activeEffectScope) { |
| 102 | activeEffectScope.cleanups.push(fn) |
| 103 | } else if (__DEV__) { |
| 104 | warn( |
| 105 | `onScopeDispose() is called when there is no active effect scope` + |
| 106 | ` to be associated with.` |
| 107 | ) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * @internal |