Skip to content

Instantly share code, notes, and snippets.

@nchanged
Last active July 29, 2016 10:30
Show Gist options
  • Save nchanged/d9908ae3d3518061133332d35d00f382 to your computer and use it in GitHub Desktop.
Save nchanged/d9908ae3d3518061133332d35d00f382 to your computer and use it in GitHub Desktop.
const wait1 = (fn) => {
setTimeout(() => {
fn()
}, 100)
}
const wait2 = (fn) => {
setTimeout(() => {
fn()
}, 200)
}
const wait3 = (fn) => {
setTimeout(() => {
fn()
}, 400)
}
wait1(() => {
console.log("Finished wait1")
wait2(() => {
console.log("Finished wait2")
wait3(() => {
console.log("Finished wait3")
})
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment