Giter Club home page Giter Club logo

Comments (6)

pwittchen avatar pwittchen commented on June 14, 2024

Hi @sharmaraju352,

Thanks for reporting that issue. I'll take a look on that when I have some time.

from infinitescroll.

sharmaraju352 avatar sharmaraju352 commented on June 14, 2024

and one more thing..why it needs number_of_items to be in the table of MAX_ITEMS_PER_REQUEST. it crashes if i assign the number which is not in the table.

from infinitescroll.

pwittchen avatar pwittchen commented on June 14, 2024

"Max items per request" is a number of items per single "page". The library needs to know how many items it should load on start and when scroll reaches the bottom of the list of currently loaded items.

from infinitescroll.

sharmaraju352 avatar sharmaraju352 commented on June 14, 2024

yes i got that.but i am fetching my notifications from server and the number of notifications on the server is unknown initially.i am keeping MAX_ITEMS_PER_REQUEST=20 initially. if i detect that the number of notifications from server is less than MAX_ITEMS_PER_REQUEST then i am assingning the number of notification from server to MAX_ITEMS_PER_REQUEST.it is working flawlessly until this point.but the problem is if i have 21 notifications on my server then it will load first 20 but as soon as i scroll down it crashes.i am not able to change the value of MAX_ITEMS_PER_REQUEST dynamically.i want to assign MAX_ITEMS_PER_REQUEST=no_of_notifications_on_server%MAX_ITEMS_PER_REQUEST;

from infinitescroll.

sharmaraju352 avatar sharmaraju352 commented on June 14, 2024

how do i tell adapter about this change

from infinitescroll.

pwittchen avatar pwittchen commented on June 14, 2024

It's a separate problem. Please, create another issue for that.

Quick answer:

Now the library is not able to do that.

We can extend the library to allow to set max items per request inside InfiniteScrollListener, but it will reduce code immutability. After that, you can listen to notifications from the server and set max items per request dynamically for the listener whenever you'll receive notification from the server.

from infinitescroll.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.