Skip to content

Instantly share code, notes, and snippets.

@yomotsu
Created February 20, 2014 06:15
Show Gist options
  • Save yomotsu/9107961 to your computer and use it in GitHub Desktop.
Save yomotsu/9107961 to your computer and use it in GitHub Desktop.
$.Deferred().resolve()
.then( function () {
var d = new $.Deferred();
setTimeout( function () {
console.log( 1 );
d.resolve();
}, 1000 );
return d;
} )
.then( function () {
var d = new $.Deferred();
setTimeout( function () {
console.log( 2 );
d.resolve();
}, 500 );
return d;
} )
.then( function () {
console.log( 3 );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment