Skip to content

twilson63/hyper-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

fpjs Task/Future/Async library

Resources

Stars

Watchers

Forks

Packages

No packages published