vscroll icon indicating copy to clipboard operation
vscroll copied to clipboard

Question: Max size of items

Open richardmward opened this issue 1 year ago • 2 comments

I've been building a LitElement variant of vscroll taking the https://stackblitz.com/edit/vscroll-vue-integration and https://stackblitz.com/edit/ngx-ui-scroll-chat-app-2 as inspiration for how to do so. Largely things are coming together, with the exception that I am having to wrap the adapter.clip() in a timeout (I assume because the way reactivity works in LitElement, it needs moving into the next render cycle or something).

That aside, one of the features I would like to do is to be able to have a maximum length of the items, but am unsure how to achieve it.

The use case is streaming data (starting with an empty list), and scrolling to the bottom (unless the user turns off auto scrolling). Because it is likely this view would be left running for some time, I'd like the backing item list to be limited in size - say never larger than 5000 items, so gradually as new items are appended on one end, they are removed from the other. I'm just struggling to work out what the most appropriate functions are to do this - and wonder if you can provide any pointers.

richardmward avatar Feb 23 '23 19:02 richardmward