VueUse
tryOnScopeDispose
Category
Export Size
125 B
Last Changed
5 months ago
Safe onScopeDispose. Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
Usage
ts
import { tryOnScopeDispose
} from '@vueuse/core'
tryOnScopeDispose
(() => {
})Type Declarations
ts
/**
* Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
*
* @param fn
*/
export declare function tryOnScopeDispose
(
fn
: Fn
,
failSilently
?: boolean,
): booleanSource
Contributors
Anthony Fu
Arthur Darkstone
SerKo
Anthony Fu
ByMykel
Peter Shih