Skip to content

setTimeout - assigning timeout id to a variable throws an error TS2323: Type 'Timer' is not assignable to type 'number'. #842

Closed
@karimbeyrouti

Description

@karimbeyrouti

Using tsc v1.1.0-1 we get an error when compiling :
error TS2323: Type 'Timer' is not assignable to type 'number'.

the following code throws the compile error:

this.sTimeout = setTimeout( () => this.showDelay() , 250 );

sTimeout is defined as a number ( private var ) .

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions