Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeDestroy(this: any) {
if (overmind.mode.mode === MODE_SSR) return
// @ts-ignore
overmind.proxyStateTree.disposeTree(this[OVERMIND].tree)
if (IS_PRODUCTION) {
return
}
overmind.eventHub.emitAsync(EventType.COMPONENT_REMOVE, {
componentId,
componentInstanceId: this[OVERMIND].componentInstanceId,
name: this.$options.name || '',
})
},
}
return () => {
;(overmind as any).proxyStateTree.disposeTree(tree)
overmind.eventHub.emitAsync(EventType.COMPONENT_REMOVE, {
componentId: component.__componentId,
componentInstanceId,
name,
})
}
}, [])
componentWillUnmount() {
this.isUnmounting = true;
this.overmind.proxyStateTree.disposeTree(this.tree);
this.overmind.eventHub.emitAsync(EventType.COMPONENT_REMOVE, {
componentId: populatedComponent.__componentId,
componentInstanceId: this.componentInstanceId,
name,
});
}
onUpdate = (mutatons, paths, flushId) => {
ngOnDestroy() {
if (this.overmind.mode.mode === MODE_SSR) {
return
}
this.overmind.proxyStateTree.disposeTree(this.tree)
if (this.componentDetails) {
this.overmind.eventHub.emitAsync(EventType.COMPONENT_REMOVE, {
componentId: this.componentDetails.componentId,
componentInstanceId: this.componentDetails.componentInstanceId,
name: this.componentDetails.name,
})
}
}
}