Skip to content

Instantly share code, notes, and snippets.

@gildniy
Created September 15, 2020 00:09
Async wrapper, replacing try catch
/* The async wrapper, replacing try catch block */
// eslint-disable-next-line no-unused-vars
const asyncWrapper = fn => (...args) => fn(...args).catch(args[2]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment