func-async
v0.1.0
Published
Functional async function
Downloads
2
Readme
A golang function like helper for avoiding async function try...catch
mental model.
Installation
Using
npm
$ npm install func-async --save
Using
yarn
$ yarn add func-async
Usage
import funcAsync from 'func-async'
export async function anyFunc() {
const [answer, exception] = await funcAsync(anyPromiseLikeOperation())
if (exception) {
throw exception
}
if (answer) {
// ...
}
}
License
MIT @ Bowen Liu