Skip to content

Instantly share code, notes, and snippets.

@raytiley
Last active December 19, 2015 05:48
Show Gist options
  • Save raytiley/5906290 to your computer and use it in GitHub Desktop.
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.
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