Function combineLatestToObject

  • Monitors input reactive values, storing values as they happen to an object. Whenever a new value is emitted, the whole object is sent out, containing current values from each source (or undefined if not yet emitted)

    See combineLatestToArray to combine streams by name into an array instead.

    const sources = {
    fast: Rx.fromFunction(Math.random, { loop: true, interval: 100 }),
    slow: Rx.fromFunction(Math.random, { loop: true, interval: 200 })
    ];
    const r = Rx.combineLatestToObject(sources);
    r.onValue(value => {
    // 'value' will be an object containing the labelled latest
    // values from each source.
    // { fast: number, slow: number }
    });

    The tempo of this stream will be set by the fastest source stream. See syncToObject to have pace determined by slowest source, and only send when each source has produce a new value compared to last time.

    This source ends if all source streams end.

    Type Parameters

    Parameters

    Returns CombineLatestToObject<T>