@f/to-promise
v1.1.2
Published
Convert container to promise.
Downloads
48
Readme
to-promise
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