New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rx-combine-latest-start-undefined

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rx-combine-latest-start-undefined

Another convenient flavor of Rx.Observable.combineLatest

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

combineLatestStartUndefined for RxJS

npm install rx-combine-latest-start-undefined

Usage

This function has the exact same usage as Rx.Observable.combineLatest, including the ability to use a resultSelector function

The example below is a variation on the example at staltz/combineLatestObj.

Given these observables:

const a$ = Rx.Observable.interval(50).share();
const b$ = Rx.Observable.just('Boston').delay(125).share();
const c$ = Rx.Observable.just('Colorado').delay(200).share();

Makes an observable which does not wait until all input observables have had an onNext event before emitting. This version emits immediately with undefined placeholder values until the next emission from the observable. This can be useful for situations where you want to see data as soon as it comes in from any of the observables, and are willing to manage the undefined inputs in your app code.

import combineLatestStartUndefined from 'rx-combine-latest-start-undefined';

const state$ = combineLatestStartUndefined(a$, b$, c$).take(6);
// or const state$ = combineLatestStartUndefined({[a$, b$, c$]).take(6);

state$.subscribe(x => console.dir(x));
// Time 0:   [undefined, undefined, undefined]
// Time 50:  [0, undefined, undefined]
// Time 100: [1, undefined, undefined]
// Time 125: [1, 'Boston', undefined]
// Time 150: [2, 'Boston', undefined]
// Time 200: [2, 'Boston', 'Colorado']

Keywords

FAQs

Package last updated on 13 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc