Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Convert to new publish API.

  • Loading branch information...
commit f6fffe0d6b90b163e70c395cfd98e3f995e38025 1 parent cb14d11
@debergalis debergalis authored
View
20 examples/todos/model.js
@@ -2,20 +2,12 @@ Lists = new Meteor.Collection("lists");
Todos = new Meteor.Collection("todos");
-/* Schema support coming soon!
-
-Lists.schema({text: String});
-
-Todos.schema({text: String,
- done: Boolean,
- tags: [String]});
-*/
-
if (Meteor.is_server) {
- Meteor.publish('lists');
- Meteor.publish('todos', {
- selector: function (params) {
- return {list_id: params.list};
- }
+ Meteor.publish('lists', function (sub, params) {
+ return Lists.find();
+ });
+
+ Meteor.publish('todos', function (sub, params) {
+ return Todos.find({list_id: params.list});
});
}
View
7 packages/livedata/livedata_test_service.js
@@ -26,11 +26,8 @@ Meteor.startup(function () {
});
if (Meteor.is_server)
- Meteor.publish('ledger', {
- collection: Ledger,
- selector: function (params) {
- return {world: params.world};
- }
+ Meteor.publish('ledger', function (sub, params) {
+ return Ledger.find({world: params.world});
});
App.methods({
View
5 packages/tinytest/tinytest_server.js
@@ -2,9 +2,8 @@ Meteor.startup(function () {
Meteor._ServerTestResults.remove();
});
-App.publish('tinytest/results', {
- collection: Meteor._ServerTestResults,
- selector: function (params) { return {run_id: params.run_id} }
+App.publish('tinytest/results', function (sub, params) {
+ return Meteor._ServerTestResults.find({run_id: params.run_id});
});
App.methods({
Please sign in to comment.
Something went wrong with that request. Please try again.