#Infinite Scroll in Vertical Collection

1 messages · Page 1 of 1 (latest)

sinful fox
#

Anyone know about bi conditional scrolling in vertical collection? I tried to add it using First and Last Reached. But I just increasing memory by adding new items instead (created new array and adding same elements again and again when function is called )of Re-rendering. Help me !

candid lance
#

What is bi conditional scrolling?

Did memory never recover?
I think we just rely on the garbage collector

sinful fox
#

Infinite scrolling, I have table that list items from array. I need that table content will loop when it reach last. Same for first , It need to show last items.

@tracked currentItems = 0; //ForVerticalCollection
@tracked nextItems = 5;
@tracked prevItems = 0;
@tracked someFreshers = [
...this.freshers.slice(this.currentItems, this.nextItems),
];
@action
lastReached() {
if (this.currentItems >= this.freshers.length) {
this.currentItems = 0;
this.nextItems = 0;
}
this.currentItems = this.nextItems;
this.nextItems += 5;
this.someFreshers = [
...this.someFreshers,
...this.freshers.slice(this.currentItems, this.nextItems),
];
}

@action
firstReached() {
this.someFreshers = [...this.freshers, ...this.someFreshers];
}

#

I want to learn about vertical collection..

candid lance
#

I see the problem

#

It's how you make your array

#

You can't loop back unless you clear the array some how, otherwise it grows and grows and grows

sinful fox
#

yeah, Is any way to rerender the array without adding again and again?

candid lance
#

If (this.someFreshers.length >= this.freshers.length) {
this.someFreshers = this.freshers.slice(...)
}

candid lance