Created
March 6, 2018 07:25
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const doAsync1 = () => client.get().then(doSomething1).catch(e => { onError1(e); throw e }) | |
const doAsync2 = () => client.get().then(doSomething2).catch(e => { onError2(e); throw e }) | |
const doAsync3 = () => client.get().then(doSomething3).catch(e => { onError3(e); throw e }) | |
const doAsync4 = () => client.get().then(doSomething4).catch(e => { onError4(e); throw e }) | |
const doAsync5 = () => client.get().then(doSomething5).catch(e => { onError5(e); throw e }) | |
const doAsync6 = () => client.get().then(doSomething6).catch(e => { onError6(e); throw e }) | |
const doAsyncSerial = () => doAsync1().then(() => doAsync2()).then(() => doAsync2()).then(doSomethingSerial).catch(e => { onErrorSerial(e); throw e }) | |
const doAsyncParallel = () => Promise.all([doAsync4, doAsync5, doAsync6]).then(doSomethingParallel).catch(e => { onErrorParallel(e); throw e }) | |
const doAsync = () => doAsyncSerial().then(doAsyncParallel) | |
doAsync().then(doSomething).catch(e => onError(e)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment