Skip to content

tryOnBeforeUnmount

Category
Export Size
148 B
Last Changed
4 days ago

Safe onBeforeUnmount. Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing

Usage

ts
import { 
tryOnBeforeUnmount
} from '@vueuse/core'
tryOnBeforeUnmount
(() => {
})

Type Declarations

ts
/**
 * Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing
 *
 * @param fn
 * @param target
 */
export declare function 
tryOnBeforeUnmount
(
fn
:
Fn
,
target
?: any): void

Source

SourceDocs

Contributors

NoiseFan

Changelog

No recent changes

Released under the MIT License.