-
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
fix(expand): accept scheduler parameter #858
Conversation
@@ -22,12 +26,25 @@ export class ExpandSubscriber<T, R> extends OuterSubscriber<T, R> { | |||
private active: number = 0; | |||
private hasCompleted: boolean = false; | |||
private buffer: any[]; | |||
private _concurrent: number = Number.POSITIVE_INFINITY; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it necessarily required to have 2 fields, _concurrent
and concurrent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not. I'll fix it.
Also moves the handling of the default value for optional parameters to the expand function instead of the operator's ctor. Closes ReactiveX#841.
81117b7
to
1d6ca4c
Compare
Just updated this PR addressing the previous comments. Still missing some test cases using a custom scheduler. Suggestion are very welcome. ;) |
@@ -46,19 +53,26 @@ export class ExpandSubscriber<T, R> extends OuterSubscriber<T, R> { | |||
let result = tryCatch(this.project)(value, index); | |||
if (result === errorObject) { | |||
destination.error(result.e); | |||
} else if (!this.scheduler) { | |||
this.subscribeToProjection(result, value, index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we've lost the scalar optimization for this branch of code. if (result._isScalar) {
...etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was moved to subscribeToProjection()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thanks.
Merged with 79e9084. Thanks @luisgabriel! |
Also moves the handling of the default value for optional parameters to
the expand function instead of the operator's ctor.
Closes #841.