JSPM

promise-props-recursive

2.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7207
  • Score
    100M100P100Q134661F
  • License MIT

Recursively resolve promises within objects

Package Exports

  • promise-props-recursive
  • promise-props-recursive/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (promise-props-recursive) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

promise-props-recursive

npm version

Resolve a (potentially) deep structure of promises

Installation

$ npm install --save promise-props-recursive

Usage

var promisePropsRecursive = require('promise-props-recursive')

console.log(
  promisePropsRecursive({
    cats: Promise.resolve(['bamse', 'beans']),
    dogs: {
      schnauzers: Promise.resolve({
        kokos: {
          isSchnauzer: true,
          isCute: Promite.resolve(true),
        },
      }),
      mixed: Promise.resolve('katla'),
    },
  })
)

License

MIT-licensed. See LICENSE.