Last active
December 17, 2015 23:39
-
-
Save Pent/5690489 to your computer and use it in GitHub Desktop.
Use reactive data in find query
This file contains hidden or 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
| Client---- | |
| Deps.autorun(function() { | |
| Meteor.subscribe('messages', Session.get('room')); | |
| }); | |
| Server---- | |
| Meteor.publish('messages', function(room) { | |
| return Messages.find({room_id: room}); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment