Skip to content

Instantly share code, notes, and snippets.

@maxkorp
Created December 14, 2017 17:59
Show Gist options
  • Save maxkorp/73aa92ba0d1fc7bd0d32f1c2248fd5c4 to your computer and use it in GitHub Desktop.
Save maxkorp/73aa92ba0d1fc7bd0d32f1c2248fd5c4 to your computer and use it in GitHub Desktop.
export async function doStuff(input) {
try {
const otherstuff = await doOtherStuff(input);
return doDifferentStuff(otherstuff);
} catch (e) {
//handle
}
}
export async function doStuff2(input) {
return Promise.resolve()
.then(() => {
const otherstuff = await doOtherStuff(input);
return doDifferentStuff(otherstuff);
})
.catch((e) => {
//handle
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment