Skip to content

Instantly share code, notes, and snippets.

@nchanged
Created July 29, 2016 10:53
Show Gist options
  • Save nchanged/42e57a41d3bfd4e767857a8772e2708f to your computer and use it in GitHub Desktop.
Save nchanged/42e57a41d3bfd4e767857a8772e2708f to your computer and use it in GitHub Desktop.
const wait1 = (fn) => {
return new Promise(resolve => setTimeout(resolve, 100))
}
const wait2 = (fn) => {
return new Promise(resolve => setTimeout(resolve, 200))
}
const wait3 = (fn) => {
return new Promise(resolve => setTimeout(resolve, 300))
}
wait1()
.then(wait2)
.then(wait3)
.then(function() {
console.log("All good!");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment