Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

promise.hash.helper

stefanpenner544.4kMIT1.0.8TypeScript support: included

CI

readme

promise.hash.helper

CI

Inspired by Promise.all but rather then consuming an array it takes an object as input, and "resolves" that objects values.

Install

yarn add promise.hash.helper

or

npm install --save promise.hash.helper

Usage

const hash = require('promise.hash.helper');

let promises = {
  myPromise: resolve(1),
  yourPromise: resolve(2),
  theirPromise: resolve(3),
  notAPromise: 4
};

hash(promises).then(object => {
  // object here is an object that looks like:
  // {
  //   myPromise: 1,
  //   yourPromise: 2,
  //   theirPromise: 3,
  //   notAPromise: 4
  // }
});