You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@richardmward Thaks for using vscrol and for the issue! If I understand correctly, you want to limit the number of items currently present in the DOM. In that case, you need to use Adapter.clip along with stream update. Something like
This issue has been automatically marked as stale because it has not had recent activity. It will be closed within seven days if no further activity occurs. If it needs to remain open, add the "permanent" label.
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.
The text was updated successfully, but these errors were encountered: