0.1.0 • Published 5 years ago
func-async v0.1.0
A golang function like helper for avoiding async function try...catch mental model.
Installation
Using
npm$ npm install func-async --saveUsing
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
0.1.0
5 years ago