* Updates the stored data of the query list, and resets the `dirty` flag to `false`, so that * on change detection, it will not notify of changes to the queries, unless a new change * occurs. * * @param resultsTree The query results to store * @param identityAccessor Optional function
(resultsTree: Array<T | any[]>, identityAccessor?: (value: T) => unknown)
| 149 | * are compared as is (without any pre-processing). |
| 150 | */ |
| 151 | reset(resultsTree: Array<T | any[]>, identityAccessor?: (value: T) => unknown): void { |
| 152 | (this as {dirty: boolean}).dirty = false; |
| 153 | const newResultFlat = flatten(resultsTree); |
| 154 | if ((this._changesDetected = !arrayEquals(this._results, newResultFlat, identityAccessor))) { |
| 155 | this._results = newResultFlat; |
| 156 | (this as Writable<this>).length = newResultFlat.length; |
| 157 | (this as Writable<this>).last = newResultFlat[this.length - 1]; |
| 158 | (this as Writable<this>).first = newResultFlat[0]; |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Triggers a change event by emitting on the `changes` {@link EventEmitter}. |
nothing calls this directly
no test coverage detected