Skip to content

Instantly share code, notes, and snippets.

@gjohnson
Created January 19, 2011 00:40
Show Gist options
  • Save gjohnson/785464 to your computer and use it in GitHub Desktop.
Save gjohnson/785464 to your computer and use it in GitHub Desktop.
Deferred Example
var def = new $.Deferred(), data = [1,2,3,4,5];
setTimeout(function(){
def.resolve(data);
}, 5000);
def.then(function(data){
console.log(data);
});
console.log('whats up?');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment