Skip to content

Instantly share code, notes, and snippets.

@MeLight
Created August 9, 2012 19:50
Show Gist options
  • Save MeLight/3307484 to your computer and use it in GitHub Desktop.
Save MeLight/3307484 to your computer and use it in GitHub Desktop.
Is this supposed to publish?
//Server
Meteor.publish("requests", function(player_id) {
var self = this;
var uuid = Meteor.uuid();
var handle = Calls.find({toUser: player_id, status: "request"}).observe({
added : function(doc) {
self.set("requests", uuid, doc);
self.flush();
}
});
});
//Client
Meteor.subscribe("requests", Session.get('player_id'), function(){
var call = Requests.findOne();
Meteor.call("answerCall", call._id);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment