#Infinite Scroll in Vertical Collection
1 messages · Page 1 of 1 (latest)
What is bi conditional scrolling?
Did memory never recover?
I think we just rely on the garbage collector
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..
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
yeah, Is any way to rerender the array without adding again and again?
If (this.someFreshers.length >= this.freshers.length) {
this.someFreshers = this.freshers.slice(...)
}
This is slightly unrelated to the addon 😉