Skip to content

Commit

Permalink
Avoid creating potentially large empty arrays when clearing grid cache
Browse files Browse the repository at this point in the history
  • Loading branch information
pepijnve committed Sep 17, 2024
1 parent e034749 commit b4bec5b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,11 @@ import { GridFlowSelectionColumn } from "./vaadin-grid-flow-selection-column.js"
// Update the items in the grid cache or set an array of undefined items
// to remove the page from the grid cache if there are no corresponding items
// in the connector cache.
gridCache.setPage(page, items || Array.from({ length: grid.pageSize }));
if (items) {
gridCache.setPage(page, items);
} else {
gridCache.clearPage(page);
}
}

return items;
Expand Down

0 comments on commit b4bec5b

Please sign in to comment.