Skip to content

A javascript library for making await more functional

License

Notifications You must be signed in to change notification settings

saeho/fawait

 
 

Repository files navigation

fAwait

codecov Build Status Greenkeeper badge

Installation

npm install --save fawait

What is fAwait?

fAwait is a javascript library for working with the await syntax for promises.

Wrap your promise in the fa function, and provide errors you want to catch, and you'll receive an array you can unpack to those values. Any errors not specified will be thrown.

Read about it: Making Await More Functional in JavaScript

let [data, typeError, customBadThing] = await fa(promise, TypeError, BadThing);

Alternatives / Prior Art

  • fPromise which is a heavier-weight promise solution.
  • safe-await which converts all errors to this functional form.
  • go-for-it which converts all non-native errors to this functional form.

About

A javascript library for making await more functional

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%