Skip to content

tryOnScopeDispose

Category
Export Size
125 B
Last Changed
6 months 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(() => {

})

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

SourceDocs

Contributors

Anthony Fu
Anthony Fu
ByMykel
Peter Shih

Changelog

v12.0.0-beta.1 on
0a9ed - feat!: drop Vue 2 support, optimize bundles and clean up (#4349)

Released under the MIT License.

Talks: June 3-4 Live Coding: June 5th
Join for Free ➜
06
days
:
04
hours
:
36
minutes
:
21
seconds
: