MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / removeItems

Method removeItems

src/utils/VirtualScroller.ts:753–776  ·  view source on GitHub ↗
(keys: readonly string[])

Source from the content-addressed store, hash-verified

751 }
752
753 removeItems(keys: readonly string[]): boolean {
754 const nextEntries = this.buildEntriesAfterRemoval(keys);
755 if (!nextEntries) {
756 return false;
757 }
758
759 const currentScrollTop = this.scrollContainer.scrollTop;
760 for (const key of keys) {
761 const element = this.renderedElements.get(key);
762 if (element) {
763 if (this.resizeObserver) {
764 this.resizeObserver.unobserve(element);
765 }
766 element.remove();
767 this.renderedElements.delete(key);
768 }
769 this.invalidatedKeys.delete(key);
770 }
771
772 this.applyItemEntries(nextEntries);
773 this.scrollContainer.scrollTop = currentScrollTop;
774 this.forceVisibleRangeUpdate();
775 return true;
776 }
777
778 canInsertItems(options: VirtualScrollerInsertOptions<T>): boolean {
779 return this.buildEntriesAfterInsertion(options) !== null;

Calls 6

applyItemEntriesMethod · 0.95
getMethod · 0.65
deleteMethod · 0.65
unobserveMethod · 0.45

Tested by

no test coverage detected