-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rx.Observable.merge is not accepting Array of Observables #1308
Comments
I think this is one of the cases for a static If you're using Babel or TypeScript, for now you can just do: Rx.Observable.merge(...[observable1, observable2]); |
This as been fixed. |
@Blesh Not seeing the fix in beta10, also not as a function signature in the merge.d.ts. |
@Blesh was a static operator added? The other closed issue referred back to this one. :) |
@Blesh I don't think this has been fixed. In RC1 passing an array into merge still returns a nested Observable as stated in the original issue. |
I have the same issue here. I build up an array of observables which do, lets say install steps, then I merge them with Observable merge. And then I got the same behaviour. |
Same issue as described by @jdelaune and @oka-garaio. |
That being said, adding the |
Rx.Observable.merge(...[1,2,3]) // (?) |
I must be doing something wrong const Rx = require('rxjs');
Rx.Observable.merge([
Rx.Observable.timer(100),
Rx.Observable.timer(2),
Rx.Observable.timer(40)
])
.subscribe(); I get subscribe is not a function. No idea what's up with that. Anyone see the same?
Weird. |
Same problem in the context of an Ionic 2 app utilising Observables. This subsection of a larger observable chain breaks:
|
const Rx = require('rxjs');
Rx.Observable.merge(...[
Rx.Observable.timer(100),
Rx.Observable.timer(2),
Rx.Observable.timer(40)
])
.subscribe(); and let test: Observable<Order>[] = [];
for (let orderId of orderIds) {
test.push(this.orderService.get(orderId)) //Produces Observables with an "order" in it.
}
return Observable.merge(...test)
.flatMap(flat => flat)
.toArray()
.do(array => console.info('*ARRAY', array)); |
Why was this closed and marked as fixed? @benlesh I'm using the |
I'm currently experiencing the same issue...Though, my |
I spent some tim trying to make this work, only to find out I had to add the |
Is there any reason not to have a version of .merge that takes an array? Cause this seems like a simple PR to make, but I'd like to know if there's a reason not to do it before going ahead. |
@samal84 I think that's because
The So if you wanted |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Given:
Above code will return as a nested Observable. But if I remove the square bracket it works as expected.
The text was updated successfully, but these errors were encountered: