-
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(typings): allow bufferCreationInterval null for bufferTime #3734
Conversation
The tests for bufferTime verifies that it is possible to set bufferCreationInterval to null, but the typings did not allow it when strictNullChecks were set to true. Fixes ReactiveX#3728
My two cents: Is this consistent with other parts of the API? Are there other places where For example, of(1).subscribe(undefined); Whereas this is not: of(1).subscribe(null); // [ts] Argument of type 'null' is not assignable to parameter of type '((value: number) => void) | undefined'. For consistency, I think it should be |
The tests pass in null for bufferCreationInterval: https://github.com/ReactiveX/rxjs/blob/master/spec/operators/bufferTime-spec.ts#L24 The code sets bufferCreationInterval to null if the parameter is not included: and it later checks if it is null: Changing it to undefined is a much bigger change, but I have nothing against it. |
Yeah, you are right. It would be a bigger change and smaller changes are always more appealing. Regarding the check against Anyway, others can decide, I just thought I'd point out the consistency issue. Thanks for the PR, BTW. 👍 |
Yeah, this should probably be |
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.
add undefined
to the signature as well, please.
Thanks, @mattiash! |
Description:
The tests for bufferTime verifies that it is possible to set
bufferCreationInterval to null, but the typings did not allow it
when strictNullChecks were set to true.
Related issue (if exists):
Fixes #3728