Quick Question: Separate data from multiples subs in client
I'm subscribed to several publications that are publishing a lot of data to the same collection. In client I'm having to remake all queries I did to publish the data so I can separate which data is about each sub.
This seems redundant to me, but I found no better way, except by publishing each data to a separate client-only collection using publish-composite package.
The question is: is this a bad practice? what is the down side? is it gonna take a tow in scalability or client performance?
Posted Jun 12, 2015, 9:30 PM UTC
I tend to stick a function in /lib that takes some parameters and returns an object for querying the collection. That way, usually all I need access to is a few properties/URL parameters, and I don't have duplicate queries everywhere. A function called in multiple places seems sufficiently less redundant to make this a non issue, for me at least.