promise-props

Home > @pearden/promise-props

promise-props package

A simple extension for promise

Functions

Function Description
init() Mount props and propsDeep functions onto Promise, so that they can be used as static methods of Promise
props(obj) The props() function takes an enumerable object as input and returns a single Promise. This returned promise fulfills when all the input’s top level promise properties fulfill (including when an empty iterable is passed), with an object of the fulfillment values as properties. It rejects when any of the input’s property rejects, with this first rejection reason.
propsDeep(obj) The propsDeep() function takes an enumerable object as input and returns a single Promise. This returned promise fulfills when all the input’s promise properties fulfill (regardless of the property level) (including when an empty iterable is passed), with an object of the fulfillment values as properties. It rejects when any of the input’s property rejects, with this first rejection reason.