Package Exports
- pull-promise
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 (pull-promise) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
pull-promise
Pull the value from a promise using pull-streams
Installation
$ npm install pull-promise
API
.promiseToSink(Promise)
Creates a sink stream with the resolved promise value.
const { promiseToSink } = require('./')
pull(
promiseToSink(Promise.resolve(5)),
pull.log()
)
// -> 5
.promiseToThrough(Promise)
Creates a through stream with the resolved promise value as output.
const { promiseToThrough } = require('./')
const delay = (delay) => new Promise((resolve) => setTimeout(resolve, delay))
pull(
pull.values([Date.now()]),
promiseToThrough(delay(500)),
pull.log()
)
// -> date after 500ms
Tests
$ npm test