How to use the overmind.EventType.COMPONENT_REMOVE function in overmind

To help you get started, we’ve selected a few overmind examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cerebral / overmind / packages / node_modules / overmind-vue / src / index.ts View on Github external
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 || '',
      })
    },
  }
github cerebral / overmind / packages / node_modules / overmind-react / src / index.ts View on Github external
return () => {
          ;(overmind as any).proxyStateTree.disposeTree(tree)
          overmind.eventHub.emitAsync(EventType.COMPONENT_REMOVE, {
            componentId: component.__componentId,
            componentInstanceId,
            name,
          })
        }
      }, [])
github codesandbox / codesandbox-client / packages / app / src / app / overmind / createConnect.ts View on Github external
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) => {
github cerebral / overmind / packages / node_modules / overmind-angular / src / directive.ts View on Github external
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,
      })
    }
  }
}