Last active
December 19, 2015 05:48
-
-
Save raytiley/5906290 to your computer and use it in GitHub Desktop.
Looking for someone to sanity check me. Even with a 10 second delay on the server, the console message gets logged immediatly indicating that $.when is resolving the promises immediately.
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
var clips = [ | |
App.Clip.create({name: 'test one'}), | |
App.Clip.create({name: 'test two'}), | |
]; | |
var saveAll = function() { | |
clips.map(function(clip) { | |
return clip.save(); | |
}); | |
} | |
$.when.apply(null, saveAll()).then(function() { | |
console.log('All Clips Saved'); //This gets executed immediatly before the clips are saved | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment