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(bindNodeCallback): emit undefined when callback has no success ar… #2329

Merged
merged 1 commit into from
Feb 14, 2017
Merged

fix(bindNodeCallback): emit undefined when callback has no success ar… #2329

merged 1 commit into from
Feb 14, 2017

Conversation

mpodlasin
Copy link
Contributor

Description:

Currently when callback is called without success arguments (second and following arguments),
bindNodeCallback emits empty array.

In RxJS 4 undefined is emitted instead as can be seen here:
https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/perf/operators/fromnodecallback.js#L23-L24
(when results array is empty results[0] returns undefined which is then emitted)

Related issue (if exists):
Related issue with bindCallback #2328
Closes #2254

…guments

Emit undefined insteady of empty array by resulting Observable,
when callback function is called without success parameters.

Closes #2254
@coveralls
Copy link

coveralls commented Feb 6, 2017

Coverage Status

Coverage remained the same at 97.689% when pulling 8b81fc6 on Podlas29:bind-node-callback-no-callback-arguments into 6ce4773 on ReactiveX:master.


boundCallback()
.subscribe((x: any) => {
results.push(typeof x);
Copy link
Member

Choose a reason for hiding this comment

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

just curiosity, is there reason to push type instead of actual value to assert with undefined directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess just habit of "everyone can set undefined value, so never trust it". All JS resources used to be very paranoid when I was learning. ;)

Copy link
Member

@kwonoj kwonoj left a comment

Choose a reason for hiding this comment

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

Change looks ok to me.

@jayphelps jayphelps merged commit 589b7f6 into ReactiveX:master Feb 14, 2017
@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