Hello I want to solve an angular bug: private…
- User
Hello I want to solve an angular bug: private removeFilterByColumnsToHide(activeColumnsIds: string[], gridState: GridState): void { const hiddenColumns = new Set( this.originalListItems .filter((column) => !activeColumnsIds.includes(column.id.toString())) .map((column) => column.id.toString()), );
gridState.filterState.filters.ids .map((id) => gridState.filterState.filters.entities[id]) .forEach((filter) => { if (hiddenColumns.has(filter.id.toString())) { this.gridService.changeFilterValue({ id: filter.id, filterValue: { ...filter.value, value: filter.value.kind === 'multiple-discrete-value' ? [] : '', }, }); } });} public changeFilterValue(changeFilterValueAction: ChangeFilteringAction): void { this.store.state$ .pipe( take(1), concatMap((state) => this.filterManager.changeFilterValue(changeFilterValueAction, state)), concatMap((state) => this.filterManager.changeFilterOperation(changeFilterValueAction, state), ), concatMap((state) => this.filterManager.applyFilters(state)), concatMap((state) => this.dataRowLoader.unselectAllRows(state)), concatMap((state) => this.resetPage(state)), concatMap((state) => this.refreshRows(state)), ) .subscribe((state) => this.commit(state)); } I THINK I shouldn't do those 4 operations each time: concatMap((state) => this.filterManager.applyFilters(state)), concatMap((state) => this.dataRowLoader.unselectAllRows(state)), concatMap((state) => this.resetPage(state)), concatMap((state) => this.refreshRows(state)), i'm SURE I shouldn't do resetPage and refreshRows each time. Can you show me alternative?
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.