#Observable with several sources

4 messages · Page 1 of 1 (latest)

mint arrow
#

I have two subjects doing their stuff then returning an Observable<MyObject>
I need an observable of type Observable<MyObject> to listen to both.
How do i do this?
I think i miss an rxjs operator

glass lava
#

It depends of what you want to achieve. merge, combineLatest, forkJoin are good candidates but with different goals

mint arrow
#

Yeah... I tried to use merge but I thought it accepts an array of observable and not several ones. So it did not work at expected.
In the end, I used the good operator, but i called it like this merge([obs1,obs2]), instead of merge(obs1,obs2)...
So i thought it was not the good one.
Anyway, the subject which i'm listening to are from a user click.
So i don't know if merge is the best candidate. It might be combineLatest.
Thanks for your input!