concatLatestFrom included in RxJS #6974
Replies: 3 comments 9 replies
-
Hey, I'm a bit late to this, but I agree that this would be a good addition to rxjs. I use it now in ngrx, and prior to that, I used my own home-brewed version of that operator. I imagine it would be useful beyond ngrx. For a better explanation of what this does, see concatLatestFrom here. But, in short (and cribbing from the link above), it works link withLatestFrom, but lazily evaluates the provided Observable factory. This allows you to use the source value when selecting additional sources to concat, and prevents evaluation until necessary. |
Beta Was this translation helpful? Give feedback.
-
The actual implementation is nothing more than a combination of existing operators: https://github.com/ngrx/platform/blob/ee00ed404386b8be252dd095b3f3a8a6f5b8c90f/modules/effects/src/concat_latest_from.ts#L55-L57 I do not believe rxjs core need to expand its api surface to include. |
Beta Was this translation helpful? Give feedback.
-
I see that this has been closed, which seems odd, since it is just a discussion. To motivate this just a bit more: I've use rxjs pretty extensively in an Angular application since before Angular 2 was released. In all the time I used it, only once was I motivated to write my own operator. I called it The point is that this operator was really the only gap I ever found for my needs in the rxjs operators. Obviously an anecdote is not data, but I do think that this operator fills a valuable missing role in the official API. |
Beta Was this translation helpful? Give feedback.
-
NgRx introduced
concatLatestFrom
in v11, it seems to be interesting in certain performances contexts so I would like to know if it could/should be included in RxJS directly and if no, for which considerations it should be out of scope.Does someone know if
concatLatestFrom
could/should be introduced in RxJS? 🙂Beta Was this translation helpful? Give feedback.
All reactions