Files
moeka-project/.agents/skills/vueuse-functions/references/tryOnScopeDispose.md
T
2026-03-16 00:19:06 +08:00

492 B

category
category
Component

tryOnScopeDispose

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

Usage

import { tryOnScopeDispose } from '@vueuse/core'

tryOnScopeDispose(() => {

})

Type Declarations

/**
 * Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
 *
 * @param fn
 */
export declare function tryOnScopeDispose(
  fn: Fn,
  failSilently?: boolean,
): boolean