tryOnScopeDispose ​
Safe onScopeDispose
. Call onScopeDispose()
if it's inside an effect scope lifecycle, if not, do nothing
Usage ​
js
import { tryOnScopeDispose } from '@vueuse/core'
tryOnScopeDispose(() => {
})
Type Declarations ​
typescript
/**
* Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
*
* @param fn
*/
export declare function tryOnScopeDispose(fn: Fn): boolean
Source ​
Contributors ​
Anthony Fu
Anthony Fu
ByMykel
Peter Shih
Changelog ​
v12.0.0-beta.1
on 11/21/2024