Skip to content

Why is there No combineLatestWith counterpart to WithLatestFrom ??? #3831

Closed
@Sheshlok

Description

@Sheshlok

Hi - I am facing an issue where the source observable completes before the other observable starts emitting items. The marble diagram of 'combineLatest' seems best suited and VERY DIFFERENT for that purpose as against 'withLatestFrom'. Using Observable.combineLatest achieves the purpose, although via a much longer route, as it leads to writing multiple 'Observable.combineLatest' functions (as 2 of them cannot be chained together).

Is there a way I can chain several 'combineLatest' operators (in a similar way that I can chain several 'withLatestFrom' operators). Can you help ?
On a side note, do you have any advice on how to deal with the onCompleted state of 1 of the observables when we are combining 2 or more observables, if I face similar problems while chaining operators in future ? Breaking the chain into multiple function calls seems very anti-elegant.

1. Note in this particular use case described above, withLatestFrom behaves very differently from CombineLatest as evident from marble diagrams. Essentially, it does not emit any item at all, if the
other observable (a longer chained call for instance) returns later than source observable.
2. I cannot use 'zipWith' as I need to reflect latest changes in UI whenever any observable emits an item

screen shot 2016-04-05 at 4 42 24 am

screen shot 2016-04-05 at 4 42 36 am

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions