hyper-async
v1.1.2
Published
Async is a tiny FP library for javascript
Downloads
5,355
Readme
hyper-async
Async is a tiny FP library for javascript
install
npm install hyper-async
Usage
import Async from 'hyper-async'
async function main() {
const x = await Async.of(1)
.chain(x => Async.fromPromise(fetch)('https://jsonplaceholder.typicode.com/posts/' + x))
.chain(res => Async.fromPromise(res.json.bind(res))())
.map(prop('title'))
.toPromise()
console.log(x)
})
main()