Created
January 31, 2017 03:27
-
-
Save liondancer/b346101f70d6dc0b88433246cc555741 to your computer and use it in GitHub Desktop.
Nested while loop skeleton
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 func = () => { | |
if (condition) { | |
return asyncCall().then(() => { | |
if (condition) { | |
if (condition) { | |
// continue looping | |
return func(); | |
} else { | |
console.log('some logic'); | |
} | |
} else { | |
if (condition) { | |
return func(); | |
} else { | |
// run a different function that also returns a Promise | |
return diffFunc(); | |
} | |
} | |
}); | |
} else { | |
return Promise.resolve() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment