Package Exports
- futurize-p
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 (futurize-p) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
futurize-p
Turns a function that returns a promise into a function that returns a future.
install
npm install futurize-p
example
const {Future} = require('ramda-fantasy')
const futurize = require('futurize-p')(Future) // pass in an implementation of Future
const incrementLater = (ms, n) => new Promise((resolve, reject) => {
setTimeout(() => {
resolve(n + 1)
}, ms)
})
const futureIncrement = futurize(incrementLater)
futureIncrement(500, 7).fork(
console.error,
console.log //=> 8
)