How to use async-each - 5 common examples

To help you get started, we’ve selected a few async-each 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 laconalabs / elliptical / src / phrase.js View on Github external
data(input)
    }

    if (this._handleParse) {
      parseElement()
    } else {
      // Update the extension cache
      this._checkExtensions(options.getExtensions(this.name))

      // Check the extenders - don't call done until all are complete
      asyncEach(Object.keys(this._extenders), (extender, done) => {
        this._extenders[extender].parse(input, options, sendData, done)
      }, extendersDone)

      // Check the overriders - don't call phrase parse unless none return data
      asyncEach(Object.keys(this._overriders), (overrider, done) => {
        this._overriders[overrider].parse(input, options, overriderData, done)
      }, overridersDone)
    }
  }
}
github laconalabs / elliptical / src / phrase.jsx View on Github external
data(input)
    }

    if (this.element._handleParse) {
      parseElement()
    } else {
      // Update the extension cache
      this._checkExtensions(options.getExtensions(this.descriptor.Constructor))

      // Check the extenders - don't call done until all are complete
      asyncEach(Object.keys(this.supplementers), (supplementer, done) => {
        this.supplementers[supplementer].parse(input, options, sendData, done)
      }, extendersDone)

      // Check the overriders - don't call phrase parse unless none return data
      asyncEach(Object.keys(this.overriders), (overrider, done) => {
        this.overriders[overrider].parse(input, options, overriderData, done)
      }, overridersDone)
    }
  }
}
github laconalabs / elliptical / src / phrase.js View on Github external
return
    }

    // If it is optional, a branch will skip it entirely
    if (this.props.optional) {
      data(input)
    }

    if (this._handleParse) {
      parseElement()
    } else {
      // Update the extension cache
      this._checkExtensions(options.getExtensions(this.name))

      // Check the extenders - don't call done until all are complete
      asyncEach(Object.keys(this._extenders), (extender, done) => {
        this._extenders[extender].parse(input, options, sendData, done)
      }, extendersDone)

      // Check the overriders - don't call phrase parse unless none return data
      asyncEach(Object.keys(this._overriders), (overrider, done) => {
        this._overriders[overrider].parse(input, options, overriderData, done)
      }, overridersDone)
    }
  }
}
github nmrony / gtni / src / index.js View on Github external
packagePaths(branchName, (error, packagePaths) => {
    if (error) {
      listSpinner.fail('Listing package.json is not successful.')
      return done(error)
    }

    // is there any package.json?
    if (!packagePaths.length) {
      listSpinner.info('No package.json is found in your project. Skipping dependency installation.')
      return done(NO_PACKAGE_FOUND)
    }
    listSpinner.succeed(`Found ${packagePaths.length} package.json files.`)
    npmInstallSpinner.start(`Installing dependencies for branch ${branchName}`)
    each(
      packagePaths,
      (path, cb) => {
        shell.cd(path)
        const yarnLockExists = detectPackageManager(path)
        return npmInstall(
          (exitCode, output) => {
            const currentWarning = output.match(/((warn).+)/gim) || []

            if (currentWarning && currentWarning.length) {
              warningLog.push({
                packagePath: path + 'package.json',
                messages: currentWarning
              })
            }

            if (exitCode || output.toLowerCase().indexOf('err!') !== -1) {
github laconalabs / elliptical / src / phrase.jsx View on Github external
_.find(input.stack, {constructor: this.descriptor.Constructor})
    ) return done()

    // If it is optional, a branch will skip it entirely
    if (this.element.props.optional) {
      data(input)
    }

    if (this.element._handleParse) {
      parseElement()
    } else {
      // Update the extension cache
      this._checkExtensions(options.getExtensions(this.descriptor.Constructor))

      // Check the extenders - don't call done until all are complete
      asyncEach(Object.keys(this.supplementers), (supplementer, done) => {
        this.supplementers[supplementer].parse(input, options, sendData, done)
      }, extendersDone)

      // Check the overriders - don't call phrase parse unless none return data
      asyncEach(Object.keys(this.overriders), (overrider, done) => {
        this.overriders[overrider].parse(input, options, overriderData, done)
      }, overridersDone)
    }
  }
}

async-each

No-bullshit, ultra-simple, 35-lines-of-code async parallel forEach / map function for JavaScript.

MIT
Latest version published 2 years ago

Package Health Score

71 / 100
Full package analysis

Popular async-each functions