I finally solved this problem. The solution is to have only a client collection, for example:
# on client
then when the scroll point is reached, request a server for the following products N ( limitNo )
# on client Meteor.call 'getProducts', limitNo, skipNo, (err, products) => _.each products, (item, index) =>
skipNo incremented by N to always query for the next data set. And on the server side I have:
# on server Meteor.methods getProducts: (limitNo, skipNo) -> productsCursor = Products.find( {}, { limit: limitNo, skip: skipNo }) productsCursor.fetch()
this Meteor method returns me the next set of products from the product collection.
Of course, the ProductDisplayed collection template templates are displayed:
Template.products.products = -> ProductsDisplayed.find {}
So what do you think?
krzysu
source share