Swap out one `DataSource` for another.
(
oldDs: DataSource<T> | null,
newDs: DataSource<T> | null,
)
| 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() { |
no test coverage detected