Last active
July 29, 2016 10:30
-
-
Save nchanged/d9908ae3d3518061133332d35d00f382 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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