0
Meteor.publish("items", (limit) => {
  return items.find({}, {limit: limit || 15});
})

renderMoreItems(){
 const newRenderedItems = items.find(this.state.options, {
   skip: this.state.rendered,
   sort: {dateCreated: -1}
 }).fetch();
} 

I am pretty sure my problem is trying to retrieve data when the server has only sent the 15. So I am trying to find a way to request for the server to send another 15 items in the collection and skip the past 15.

How do I request more data from the server without calling Meteor.subscribe again. Ive read somewhere that it is really slow and is not recommended. Previously I had the server sending over all the data and then it filtered it on the client side, and it was very slow.

user8813240
  • 125
  • 1
  • 7

1 Answers1

0

skip can be used for this purpose.

The query can look like

Meteor.publish("items", (limit,skip) => {
  return items.find({}, {limit: limit || 15,skip : skip});
})

There is no other alternative to calling Meteor.subscribe again and this is the recommended way.

Ankit
  • 1,118
  • 13
  • 21