How to use the @reactivex/rxjs.Observable.combineLatest function in @reactivex/rxjs

To help you get started, we’ve selected a few @reactivex/rxjs 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 giltig / rxfrf / src / shared / stores / index.js View on Github external
import {Observable} from '@reactivex/rxjs'
import counterStore from './counterStore'
import routerStore from './routerStore'

// You can enter more stores here
export default Observable.combineLatest(counterStore, 
                                        routerStore,
                                        (counterStore, 
                                         routerStore) => {
                                          return Object.assign({}, 
                                                               counterStore,
                                                               routerStore)
                                        })
github OmniSharp / omnisharp-node-client / lib / helpers / pausableBuffered.ts View on Github external
constructor(destination: Subscriber, private _self: Observable, private _pauser: Observable) {
        super(destination);

        let previousShouldFire: boolean;
        destination.add(
            Observable.combineLatest(_self, _pauser)
                .subscribe(([data, shouldFire]) => {
                    if (previousShouldFire !== undefined && shouldFire !== previousShouldFire) {
                        previousShouldFire = shouldFire;
                        // change in shouldFire
                        if (shouldFire) { this._drainQueue(); }
                    } else {
                        previousShouldFire = shouldFire;
                        // new data
                        if (shouldFire) {
                            this._next(data);
                        } else {
                            this._queue.push(data);
                        }
                    }
                }, e => {
                    this._drainQueue();