Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/tryOnScopeDispose.md
1---2category: Component3---45# tryOnScopeDispose67Safe `onScopeDispose`. Call `onScopeDispose()` if it's inside an effect scope lifecycle, if not, do nothing89## Usage1011```ts12import { tryOnScopeDispose } from '@vueuse/core'1314tryOnScopeDispose(() => {1516})17```1819## Type Declarations2021```ts22/**23* Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing24*25* @param fn26*/27export declare function tryOnScopeDispose(28fn: Fn,29failSilently?: boolean,30): boolean31```32