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

Package detail

@f/object-to-promise

micro-js20MIT1.1.3

Convert an object to a promise.

readme

object-to-promise

Build status Git tag NPM version Code style

Convert an object to a promise.

Installation

$ npm install @f/object-to-promise

Usage

var objectToPromise = require('object-to-promise')

objectToPromise({
  1: Promise.resolve(1),
  2: Promise.resolve(2)
}).then(function (obj) {
  console.log(obj) // => { 1: 1, 2: 2 }
})

API

objectToPromise(object)

  • object - an object of "resolavables"

Returns: a promise

License

MIT