MCPcopy Index your code
hub / github.com/angular/angular / reset

Method reset

packages/core/src/linker/query_list.ts:151–160  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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}.

Callers

nothing calls this directly

Calls 2

flattenFunction · 0.90
arrayEqualsFunction · 0.90

Tested by

no test coverage detected