Skip to content

Instantly share code, notes, and snippets.

@jhackett1
Last active January 5, 2018 14:44
Show Gist options
  • Save jhackett1/ca2c452c5e0d92fc3246f72ea60a9c34 to your computer and use it in GitHub Desktop.
Save jhackett1/ca2c452c5e0d92fc3246f72ea60a9c34 to your computer and use it in GitHub Desktop.
A simple blocking function, used for async exercises
// 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