Skip to content

Promise.all wrapper for easier error handling when using async/await

License

Notifications You must be signed in to change notification settings

neosiae/await-to-all

Repository files navigation

await-to-all

npm Travis (.com) branch npm npm bundle size code style: prettier

Promise.all wrapper for easier error handling when using async/await

Install

$ npm install await-to-all

Usage

const toAll = require('await-to-all')

async function someAsyncFunction() {
  const [error, data] = await toAll([Promise, Promise, Promise])

  if (error) {
    console.error(error)
  }

  console.log(data)
}

See Also

await-to-js

License

MIT

About

Promise.all wrapper for easier error handling when using async/await

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published