Skip to content
On this page

tryOnScopeDispose

Category
Export Size
183 B
Last Changed
3 weeks ago

Safe onScopeDispose. Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing

Usage

js
import { tryOnScopeDispose } from '@vueuse/core'

tryOnScopeDispose(() => {

})
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
/**
 * Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
 *
 * @param fn
 */
export declare function tryOnScopeDispose(fn: Fn): boolean

Source

SourceDocs

Contributors

Anthony Fu
ByMykel
Peter Shih

Changelog

No recent changes

Released under the MIT License.