Skip to content

Commit

Permalink
refactor: remove use of setProperties in grid items (#6678)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomivirkki authored Oct 20, 2023
1 parent b8956eb commit f1d6c02
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions packages/grid/src/vaadin-grid-array-data-provider-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ export const ArrayDataProviderMixin = (superClass) =>
__setArrayDataProvider(items) {
const arrayDataProvider = createArrayDataProvider(this.items, {});
arrayDataProvider.__items = items;
this.setProperties({
_arrayDataProvider: arrayDataProvider,
size: items.length,
dataProvider: arrayDataProvider,
});
this._arrayDataProvider = arrayDataProvider;
this.size = items.length;
this.dataProvider = arrayDataProvider;
}

/** @private */
Expand All @@ -47,17 +45,13 @@ export const ArrayDataProviderMixin = (superClass) =>

if (dataProvider !== this._arrayDataProvider) {
// A custom data provider was set externally
this.setProperties({
_arrayDataProvider: undefined,
items: undefined,
});
this._arrayDataProvider = undefined;
this.items = undefined;
} else if (!items) {
// The items array was unset
this.setProperties({
_arrayDataProvider: undefined,
dataProvider: undefined,
size: 0,
});
this._arrayDataProvider = undefined;
this.dataProvider = undefined;
this.size = 0;
this.clearCache();
} else if (this._arrayDataProvider.__items === items) {
// The items array was modified
Expand Down

0 comments on commit f1d6c02

Please sign in to comment.