1.1.2 • Published 8 years ago

@f/to-promise v1.1.2

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

to-promise

Build status Git tag NPM version Code style

Convert container to promise.

Installation

$ npm install @f/to-promise

Usage

var toPromise = require('@f/to-promise')

toPromise({
  a: Promise.resolve(1)
}).then(function (res) {
  res // => {a: 1}
})

toPromise([1]).then(function (res) {
  res // => [1]
})

API

toPromise(container)

  • container - A container of some kind to convert (array, object, generator, or thunk)

Returns: a promise

License

MIT