Skip to content
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

fix(subscribeToResult): accept array-like as result #2364

Merged
merged 1 commit into from
Feb 13, 2017
Merged

fix(subscribeToResult): accept array-like as result #2364

merged 1 commit into from
Feb 13, 2017

Conversation

mpodlasin
Copy link
Contributor

Description:

Observable.from and operators using subscribeToResult both use interface ObservableInput for describing their input, so it follows that they should accept and work properly on the same kind of input.

And yet

Observable.from({0: 0, 1: 1, length: 2});

works as expected on array-likes, while

Observable.merge({0: 0, 1: 1, length: 2});

errors, saying that given argument is not proper observable.

Since array-likes belong to ObservableInput interface, I submit fix that makes operators using subscribeToResult work properly with array-likes.

Accept array-like as a result to subscribe, so that
Observable.from and operators using subscribeToResult
have identical behaviour.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0003%) to 97.689% when pulling 14685ba on Podlas29:observable-input-as-array-like into 31dfc73 on ReactiveX:master.

Copy link
Member

@jayphelps jayphelps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent find and code. I'd like another reviewer just to confirm.

@jayphelps jayphelps requested a review from benlesh February 13, 2017 19:16
@jayphelps jayphelps merged commit 3f01114 into ReactiveX:master Feb 13, 2017
@jayphelps jayphelps removed the request for review from benlesh February 13, 2017 23:20
@lock
Copy link

lock bot commented Jun 6, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants