) {
if (target) {
;(target[type] || (target[type] = [])).push((...args: any[]) => {
+ if (target.isUnmounted) {
+ return
+ }
// disable tracking inside all lifecycle hooks
// since they can potentially be called inside effects.
pauseTracking()
user: { [key: string]: any }
// lifecycle
+ isUnmounted: boolean
[LifecycleHooks.BEFORE_CREATE]: LifecycleHook
[LifecycleHooks.CREATED]: LifecycleHook
[LifecycleHooks.BEFORE_MOUNT]: LifecycleHook
// lifecycle hooks
// not using enums here because it results in computed properties
+ isUnmounted: false,
bc: null,
c: null,
bm: null,
// unmounted hook
if (um !== null) {
queuePostEffect(um, parentSuspense)
+ // set unmounted after unmounted hooks are fired
+ queuePostEffect(() => {
+ instance.isUnmounted = true
+ }, parentSuspense)
}
}