Created
July 10, 2013 18:24
-
-
Save objectiveSee/5968782 to your computer and use it in GitHub Desktop.
Right now drawAnswers() gets called before makeDeckIfNeeded() promise is fulfilled. How do I fix that? Does it involve bind()?
This file contains 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
return Q.fcall(game.makeDeckIfNeeded.bind(game)) | |
.then(game.deck.drawAnswers(participant, cardsToGet)) | |
.then(function(newCards) { | |
// add newcards to hand | |
var newHand = _.union(h,newCards); | |
participant.hand = newHand; | |
return Q.fcall(function() { return game.update(); }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment