This repository has been archived by the owner on Oct 1, 2021. It is now read-only.
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.
Bi-Directional Infinite Scrolling #148
Open
Description
Some 1d collections need bi-directional infinite scrolling. A good example is a calendar that is initialized with today's date but allows the user to view past dates. Allowing negative indexes would be one way to implement this. Where 0 is today and -1 is yesterday and so on.
import { ItemSource } from 'virtual-scroller';
import { addDays, startOfToday } from 'date-fns';
new ItemSource({
getLength(): number {
return Infinity;
},
item(index: number): Date {
return addDays(startOfToday(), index);
}
});
Metadata
Assignees
Labels
No labels