Skip to content

Instantly share code, notes, and snippets.

@MeLight
Created August 8, 2012 22:57
Show Gist options
  • Save MeLight/3299564 to your computer and use it in GitHub Desktop.
Save MeLight/3299564 to your computer and use it in GitHub Desktop.
Do I need autosub here?
//Client
Meteor.subscribe("requests", Session.get('player_id'), function(){
var call = Calls.findOne();
Meteor.call("answerCall", call._id);
});
//Server
Meteor.publish("requests", function(player_id) {
if(player_id == undefined) return null;
return Calls.find({toUser: player_id, status: "request"});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment