Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Promise stuff
function hello(resolve) {
// do whatever
resolve();
}
function hello2(resolve) {
// do whatever
resolve();
}
function helloLast() {
console.log('all done');
}
function runthisfirst() {
return new Promise(function(resolve, reject) {
hello(resolve);
hello2(resolve);
});
}
runthisfirst().then(() => {
helloLast();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment