How to use the overmind.EventType.COMPONENT_UPDATE 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-components / src / component.ts View on Github external
function postpatch(_, nextNode) {
  try {
    const component = nextNode.data.component
    if (nextNode.flushId) {
      getApp().eventHub.emitAsync(EventType.COMPONENT_UPDATE, {
        componentId: component.componentId,
        componentInstanceId: component.componentInstanceId,
        name: component.name,
        flushId: component.flushId,
        paths: Array.from(component.tree.pathDependencies) as any,
      })
    }
  } catch (error) {
    console.log(error.message)
  }
}
github codesandbox / codesandbox-client / packages / app / src / app / overmind / createConnect.ts View on Github external
componentDidUpdate() {
      if (this.isUpdating) {
        this.overmind.eventHub.emitAsync(EventType.COMPONENT_UPDATE, {
          componentId: populatedComponent.__componentId,
          componentInstanceId: this.componentInstanceId,
          name,
          flushId: this.currentFlushId,
          paths: Array.from(this.tree.pathDependencies as Set),
        });
        this.isUpdating = false;
      }
    }
    componentWillUnmount() {
github cerebral / overmind / packages / node_modules / overmind-react / src / index.ts View on Github external
componentDidUpdate() {
          if (this.isUpdating) {
            this.overmind.eventHub.emitAsync(EventType.COMPONENT_UPDATE, {
              componentId: populatedComponent.__componentId,
              componentInstanceId: this.componentInstanceId,
              name,
              flushId: this.currentFlushId,
              paths: Array.from(this.tree.pathDependencies as Set),
            })
            this.isUpdating = false
          }
        }
        componentWillUnmount() {
github cerebral / overmind / packages / node_modules / overmind-vue / src / index.ts View on Github external
updated(this: any) {
            if (overmind.mode.mode === MODE_SSR) return

            this[OVERMIND].tree.stopTracking()

            if (this[OVERMIND].isUpdating) {
              overmind.eventHub.emitAsync(EventType.COMPONENT_UPDATE, {
                componentId,
                componentInstanceId: this[OVERMIND].componentInstanceId,
                name: this.$options.name || '',
                flushId: this[OVERMIND].currentFlushId,
                paths: Array.from(this[OVERMIND].tree.pathDependencies) as any,
              })
              this[OVERMIND].isUpdating = false
            }
          },
        }),
github cerebral / overmind / packages / node_modules / overmind-angular / src / directive.ts View on Github external
;(window['__zone_symbol__setTimeout'] || setTimeout)(() => {
        this.overmind.eventHub.emitAsync(EventType.COMPONENT_UPDATE, {
          componentId: this.componentDetails.componentId,
          componentInstanceId: this.componentDetails.componentInstanceId,
          name: this.componentDetails.name,
          paths: Array.from(this.tree.pathDependencies) as any,
          flushId,
        })
      })
    }