1.1.2 • Published 10 months ago

hyper-async v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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()