fix(typings): allow bufferCreationInterval null for bufferTime#3734
fix(typings): allow bufferCreationInterval null for bufferTime#3734benlesh merged 2 commits intoReactiveX:masterfrom
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 |
benlesh
left a comment
There was a problem hiding this comment.
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