Meteor Publication Factory
Helps you to create standardized publications for common use cases.
Usage
1const Toys = new Mongo.Collection("toys"); 2 3const allToys = PublicationFactory.createPublication({ 4 collection: Toys, 5 fields: { 6 title: 1, 7 brand: 1, 8 price: 1, 9 }, 10 filter: { 11 brand: "Company A", 12 }, 13 roles: { 14 names: [ "read-toys" ], 15 domain: "toystore", 16 }, 17 limit: 20, 18 sleep: 2500, 19 logger: function(...args) { 20 // whatever you want to do here 21 }, 22}); 23 24 25Meteor.publish("allToys", allToys);