Skip to content

Instantly share code, notes, and snippets.

@objectiveSee
Created May 22, 2013 20:10
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/5630515 to your computer and use it in GitHub Desktop.
Save objectiveSee/5630515 to your computer and use it in GitHub Desktop.
/**
* question: how can I rewrite lines 8 & 9 to not use an intermediate function?
*
*
*/
Q.fcall(this.findGamesNearby.bind(this,user,location))
.then(function(games_nearby) {
return matchmaking.makeGameIfNeeded(games_nearby, user, location);
});
// games_nearby is what findGamesNearby() passes as the parameter when it calls deferred.resolve(result);
// The return value of findGamesNearby() is a deferred promise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment