/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {Observable, isObservable, of as observableOf} from 'rxjs'; import {DataSource} from './data-source'; /** DataSource wrapper for a native array. */ export class ArrayDataSource extends DataSource { constructor(private _data: readonly T[] | Observable) { super(); } connect(): Observable { return isObservable(this._data) ? this._data : observableOf(this._data); } disconnect() {} }