Last active
January 5, 2018 14:44
-
-
Save jhackett1/ca2c452c5e0d92fc3246f72ea60a9c34 to your computer and use it in GitHub Desktop.
A simple blocking function, used for async exercises
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
// A function which returns an object after one second | |
var getData = function(cb){ | |
setTimeout(function(){ | |
var data = { | |
data: "Some data", | |
moreData: "And more data", | |
lastData: true | |
} | |
cb(data) | |
}, 1000) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment