MCPcopy Create free account
hub / github.com/angular/components / _changeDataSource

Method _changeDataSource

src/cdk/scrolling/virtual-for-of.ts:299–309  ·  view source on GitHub ↗

Swap out one `DataSource` for another.

(
    oldDs: DataSource<T> | null,
    newDs: DataSource<T> | null,
  )

Source from the content-addressed store, hash-verified

297
298 /** Swap out one `DataSource` for another. */
299 private _changeDataSource(
300 oldDs: DataSource<T> | null,
301 newDs: DataSource<T> | null,
302 ): Observable<readonly T[]> {
303 if (oldDs) {
304 oldDs.disconnect(this);
305 }
306
307 this._needsUpdate = true;
308 return newDs ? newDs.connect(this) : observableOf();
309 }
310
311 /** Update the `CdkVirtualForOfContext` for all views. */
312 private _updateContext() {

Callers 1

CdkVirtualForOfClass · 0.95

Calls 2

disconnectMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected