hyper-async
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i hyper-async

Weekly Downloads

1,240

Version

1.1.2

License

MIT

Unpacked Size

9.17 kB

Total Files

8

Last publish

Collaborators

  • permaweb