You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a demo for my issue: http://jsbin.com/jepifofaha/edit?js,output (put it there because CodePen was giving me errors and was blocking the requests)
As you can notice after two requests, the page limit is reached and the API returns empty result but the InfiniteScroll isn't able to detect that and keeps sending requests infinitely.
_
An even bigger problem is when I use a Wordpress REST api endpoint (which I can't demonstrate here now), where when pagination exceeds total pages count, the request returns a HTTP 400 error which then blocks all my orher scripts and nothing else works after that.
_
Usually all these api endpoints return total pages count in the response header. The above demo returns "X_TOTAL_COUNT" in response header from which I can calculate total pages available and stop making new requests after pagination exceeds total pages available.
I'm pulling my hair out since yesterday and can't find a way to read response headers (you know basically XHR variable)
Any help or suggestion? Is it possible? Can you suggest any workaround?
The text was updated successfully, but these errors were encountered:
Infinite Scroll v4 has been released. Infinite Scroll v4 adds a new option, fetchOptions, which allows you to set method, headers, CORS mode, and other options for the fetch request
Here is a demo for my issue: http://jsbin.com/jepifofaha/edit?js,output (put it there because CodePen was giving me errors and was blocking the requests)
As you can notice after two requests, the page limit is reached and the API returns empty result but the InfiniteScroll isn't able to detect that and keeps sending requests infinitely.
_
_
Usually all these api endpoints return total pages count in the response header. The above demo returns "X_TOTAL_COUNT" in response header from which I can calculate total pages available and stop making new requests after pagination exceeds total pages available.
I'm pulling my hair out since yesterday and can't find a way to read response headers (you know basically XHR variable)
Any help or suggestion? Is it possible? Can you suggest any workaround?
The text was updated successfully, but these errors were encountered: