How to use the betsy.EventEmitter function in betsy

To help you get started, we’ve selected a few betsy 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 / src / index.ts View on Github external
!(process && process.title && process.title.includes('node'))
    ) {
      if (hotReloadingCache[name]) {
        return hotReloadingCache[name].reconfigure(configuration)
      } else {
        hotReloadingCache[name] = this
      }
    }

    /*
      Set up an eventHub to trigger information from derived, computed and reactions
    */
    const eventHub =
      mode.mode === MODE_SSR
        ? new MockedEventEmitter()
        : new EventEmitter()

    /*
      Create the proxy state tree instance with the state and a wrapper to expose
      the eventHub
    */
    const proxyStateTree = this.createProxyStateTree(
      configuration,
      eventHub,
      mode.mode === MODE_SSR ? false : process.env.NODE_ENV === 'development'
    )

    this.originalConfiguration = configuration
    this.state = proxyStateTree.state
    this.effects = configuration.effects || {}
    this.proxyStateTree = proxyStateTree
    this.eventHub = eventHub as EventEmitter

betsy

Typed events

MIT
Latest version published 6 years ago

Package Health Score

54 / 100
Full package analysis

Popular betsy functions