Comments (6)
Hello,
It looks like you are calling it wrong. merge
takes a variable number of observables, not an array. Try calling it like this:
const example = Rx.Observable.of(
Rx.Observable.timer(1),
Rx.Observable.timer(1),
Rx.Observable.timer(1)
)
This should give you the correct behavior. 👍
from learn-rxjs.
thanks! :) hate to beat a horse, but why not allow for an array as well? I am sure I am not the only one to make such a mistake or to make the same request!
from learn-rxjs.
oh duh, if you allow for an array, it will return an array. Ughhh I think it's bad the way it is.
Rx.Observable.merge
or Rx.Observable.of
should return the same type, no matter what the input.
Right now Rx.Observable.merge
will return an array, if an array is passed to it, and an Observable otherwise, that's pretty craytown TBH
from learn-rxjs.
I agree the behavior seems a little strange. I cannot speak to the intentions though, for that you will need to open up a ticket on official RxJS repo. Feel free to post a link here if you do. 👍
from learn-rxjs.
yeah thanks; I think in general with statically typed languages you can have overloaded functions/methods that return different types based off the input type, but with JS and no real overloaded methods/functions, it sure would make things easier if methods/functions always returned the same type
from learn-rxjs.
I did submit an issue, we will see what they say
thanks!
from learn-rxjs.
Related Issues (20)
- catch-spec: error variable HOT 2
- (suggestion) usage pluck for arrays HOT 2
- Add visualization
- I cannot find refCount nor publishReplay anymore HOT 2
- tetris game impure function HOT 5
- forkJoin: uses deprecated API
- Does this book has a ISBN? HOT 3
- throttleTime wrong explanation HOT 3
- Content summary on primer ? HOT 2
- https://www.learnrxjs.io offline HOT 3
- Wrong output in the concepts/time-based-operators-comparison.md HOT 2
- (suggestion) show/explain BehaviorSubject.value usage HOT 1
- combineLatest uses deprecated API
- `concatMap` example 3 uses deprecated API
- distinctUntilKeyChanged link is 404 HOT 2
- bindCallback and bindNodeCallback are missing
- Alphabet Invasion Problems
- Docs for finalize should mention behavior on unsubscribe
- Broken links on the retryWhen page HOT 3
- Is there any plans to update the documentation? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learn-rxjs.