Skip to content

Instantly share code, notes, and snippets.

@firedev
Created April 21, 2020 12:43
AsyncWrap — so there is no catch
const asyncWrap = (promise) => (
promise.then(res => [res]).catch(err => [undefined, err])
)
const func = async () => {
const [result, error] = await asynced( doStuff()) )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment