Skip to content

Commit

Permalink
Step 13.14: Publish total number of parties
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela authored and dotansimha committed Nov 27, 2016
1 parent 9a19f8a commit fbdaf9f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/imports/publications/parties.ts
@@ -1,11 +1,15 @@
import { Meteor } from 'meteor/meteor';
import { Counts } from 'meteor/tmeasday:publish-counts';

import { Parties } from '../../../both/collections/parties.collection';

interface Options {
[key: string]: any;
}

Meteor.publish('parties', function(options: Options) {
Counts.publish(this, 'numberOfParties', Parties.collection.find(buildQuery.call(this)), { noReady: true });

return Parties.find(buildQuery.call(this), options);
});

Expand Down

0 comments on commit fbdaf9f

Please sign in to comment.