R
fn

tryOnScopeDispose

v0.0.1testeddemo

A 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

ParameterTypeDescription
callbackVoidFunctionThe callback to run when the scope is disposed.

Returns

boolean- Returns true if the callback was run, otherwise false.