Swap out one `DataSource` for another.
(
oldDs: DataSource<T> | null,
newDs: DataSource<T> | null,
)
| 305 | |
| 306 | /** Swap out one `DataSource` for another. */ |
| 307 | private _changeDataSource( |
| 308 | oldDs: DataSource<T> | null, |
| 309 | newDs: DataSource<T> | null, |
| 310 | ): Observable<readonly T[]> { |
| 311 | if (oldDs) { |
| 312 | oldDs.disconnect(this); |
| 313 | } |
| 314 | |
| 315 | this._needsUpdate = true; |
| 316 | return newDs ? newDs.connect(this) : observableOf(); |
| 317 | } |
| 318 | |
| 319 | /** Update the `CdkVirtualForOfContext` for all views. */ |
| 320 | private _updateContext() { |
no test coverage detected