Skip to content

Instantly share code, notes, and snippets.

@objectiveSee
Created July 10, 2013 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save objectiveSee/5968782 to your computer and use it in GitHub Desktop.
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()?
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