Skip to content

bufferTime typings do not accept bufferCreationInterval null #3728

@mattiash

Description

@mattiash

RxJS version:
6.1.0

Code to reproduce:

import {from} from 'rxjs'
import {bufferTime} from 'rxjs/operators'

from([1,2,3]).pipe(bufferTime(1000, null, 2)).subscribe(n => console.log(n))

Expected behavior:
Typescript code should compile the code correctly with strictNullChecks.

Actual behavior:

index.ts(4,37): error TS2345: Argument of type 'null' is not assignable to parameter of type 'number'.

Additional information:

The tests for bufferTime in spec/operators/bufferTime-spec.ts test that it works to send in null as bufferCreationInterval (https://github.com/ReactiveX/rxjs/blob/master/spec/operators/bufferTime-spec.ts#L45), but the typings for bufferTime specifies that bufferCreationInterval is a number only. The reason that your tests compile is that you have strictNullChecks set to false in tsconfig.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TSIssues and PRs related purely to TypeScript issuesbugConfirmed bughelp wantedIssues we wouldn't mind assistance with.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions