Skip to content

Instantly share code, notes, and snippets.

@maxkorp
Created December 14, 2017 17:59
Show Gist options
  • Select an option

  • Save maxkorp/73aa92ba0d1fc7bd0d32f1c2248fd5c4 to your computer and use it in GitHub Desktop.

Select an option

Save maxkorp/73aa92ba0d1fc7bd0d32f1c2248fd5c4 to your computer and use it in GitHub Desktop.

Revisions

  1. maxkorp created this gist Dec 14, 2017.
    19 changes: 19 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    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
    });
    }