I am working on an infinite scroll to display data with an Angular component. The idea is when I got scroll event, I will ask to have more data by change the value of limit
when call the API.
I will stop call the API if the data.length < limit && data.length === currentData.length
but because everything is async so that this component call at least 10 times the same request for increasing limit to receive the same data. The logic to stop the call is inside the subscribe
handler.
I think I need to catch scroll end
event not only scroll
but this event not exists, is there any other approach to this problem?