/** * @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.io/license */ import {Observable, of as observableOf} from 'rxjs'; import {DataSource} from './data-source'; /** DataSource wrapper for a native array. */ export class ArrayDataSource extends DataSource { constructor(private _data: T[] | ReadonlyArray | Observable>) { super(); } connect(): Observable> { return this._data instanceof Observable ? this._data : observableOf(this._data); } disconnect() {} }