0

I use this article to create infinite scroll and this is my client and server code:

// server-side
Meteor.publish('getContactUsMessages', function(limit) {
    if (limit > ContactUsMessages.find().count()) {
        limit = 0;
    }

    return ContactUsMessages.find({ }, { limit: limit });
});

// client-side
incrementLimit = function(inc) {
    inc = inc || 2;
    newLimit = Session.get('limit') + inc;
    Session.set('limit', newLimit);
};

When I increase the limit of the find, is it going to re-fetch all the data, including the data that you already had, or does it fetch only the additional data that is needed?

1 Answer 1

2

Only the new data. You can confirm this for yourself by using your browser's inspector to look at the network traffic that occurs when you increase the limit.

Sign up to request clarification or add additional context in comments.

3 Comments

I try using browser network tool but no log shown to me.
You have to examine websockets with the inspector. That's where updates to collections come through.
Thanks a lot man. I saw all data at first but after remove autopublish package all things fixed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.