question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

combine_latest emit_on behavior

See original GitHub issue

Should we buffer the combine_latest emit_on stream?

Context

Consider the following situation, we have two streams a and b. We are going to use combine_latest to combine them, with an emit only on a. 5 entries come down from a then one comes down from b then one from a. Due to the lack of data from b none of the 5 initial a entries have been emitted since the b was missing. Now that we have b data do we expect it to emit 6 times (which would require the buffering of the emit_on stream or only once (which may violate the idea of the emit_on stream always emitting)?

@mrocklin @ordirules @danielballan

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:26 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
CJ-Wrightcommented, Aug 10, 2017

zip_product works for me. I have a version of this already in the heterogeneous sibling library: https://github.com/xpdAcq/SHED/pull/34/files#diff-65d9b3aec4fc1da045d510c0bf1badf7R979 (I can change the name, but it seems to do the job. Relevant tests: https://github.com/xpdAcq/SHED/pull/34/files#diff-dfb8639c0c54113885f051bbf83937ccR640)

1reaction
limx0commented, Aug 10, 2017

Also keen to have a zip_longest as you mentioned above, I can see that this could definitely be useful is some case.

-A-B-C-D-E---------------------------------------------F------
+
-----------------1-----------------------2-3-4-5-----------------
=
-----------------A1-B1-C1-D1-E1--------------------F5-----

What about zip_product as a name?

Edit: Nevermind I was thinking it did more of a product-like combination. I’m not 100% sure what your stream above ^^ is doing Edit2: Yep, zip_latest seems appropriate

Read more comments on GitHub >

github_iconTop Results From Across the Web

combineLatest behaviour in Rxjs 5? - Stack Overflow
Combines multiple Observables to create an Observable whose values are calculated from the latest values of each of its input Observables. or.
Read more >
combineLatest - Learn RxJS
This operator is best used when you have multiple, long-lived observables that rely on each other for some calculation or determination.
Read more >
RxJS - combineLatest vs merge Explained - BansoCode
merge and combineLatest operators are occasionally compared with each other. They both trigger an emission if one of their inner Observables ...
Read more >
CombineLatest operator - ReactiveX
The CombineLatest operator behaves in a similar way to Zip, but while Zip emits items only when each of the zipped source Observables...
Read more >
All you need to know about combineLatest operator in RxJS
Combines multiple Observable to create an Observable whose values are calculated from the latest values of each of its input Observables.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found