How to use the rx-lite.Observable.isObservable function in rx-lite

To help you get started, we’ve selected a few rx-lite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github polluxparis / zebulon-grid / src / orb / stores / Store.js View on Github external
subscribe(datasource) {
    this.data = [];
    this.filteredData = [];
    let observableDatasource = null;
    // datasource can be an observable, an array of arrays or an array of objects
    if (Array.isArray(datasource) && (Array.isArray(datasource[0]) || typeof datasource[0] === 'object')) {
      observableDatasource = Observable.of(datasource);
    } else if (Observable.isObservable(datasource)) {
      // datasource is a Rxjs observable
      observableDatasource = datasource;
    }
    if (observableDatasource) {
      this.dataSubscription = observableDatasource.subscribe(this.push.bind(this));
    }
  }