I have function where I push items to array by scrolling the page but the problem is that pushed items are repeating instead of pushing new items.
Code
onScroll(): void {
console.log('scrolled');
var i,j,newArray,chunk = 10;
for (i=0,j=this.listOfData.length; i<j; i+=chunk) {
newArray = this.listOfData.slice(i,i+chunk);
this.results = this.results.concat(newArray);
}
}
My this.listOfData
array has 19 items and it only gets 19 to 10 (repeating) 9 to 1 never shows.
Any idea?
Update
In case you have hard time understand my point i recorder small video of my issue Watch