How to use the rx-lite.Disposable 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 Foundry376 / Mailspring / app / src / global / mailspring-observables.es6 View on Github external
return Rx.Observable.create(observer => {
    const unsubscribe = QuerySubscriptionPool.add(query, result => observer.onNext(result));
    return Rx.Disposable.create(unsubscribe);
  });
};
github bengotow / electron-RxDB / src / query.js View on Github external
return Rx.Observable.create((observer) => {
      const pool = this._database._querySubscriptionPool;
      let unsubscribe = null;
      if (allowQueryChanges) {
        unsubscribe = pool.addPrivateSubscription(name, this, (v) => observer.onNext(v));
      } else {
        unsubscribe = pool.add(this, (v) => observer.onNext(v));
      }
      return Rx.Disposable.create(unsubscribe);
    });
  }