fn
tryOnScopeDispose
v0.0.1testeddemoA composable that will run a callback when the scope is disposed or do nothing if the scope isn't available.
Example
ts
tryOnScopeDispose(() => console.log('Scope disposed'));Demo
Loading demo…
Signature
ts
export function tryOnScopeDispose(callback: VoidFunction){ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
callback | VoidFunction | The callback to run when the scope is disposed. |
Returns
boolean- Returns true if the callback was run, otherwise false.