Skip to content

setTimeout() #49

@tindzk

Description

@tindzk

WindowTimers.setTimeout() has the following signature:

def setTimeout(handler: js.Any, timeout: js.Any, args: js.Any*): Int = ??? 

Some users (including myself) ran into a problem passing a block instead of a lambda. It would be helpful if the compiler could catch this on-the-fly. Therefore, I would advise changing it to:

def setTimeout(handler: () => Unit, timeout: Int): Int = ??? 

MDN also doesn't specify the additional parameters, which appear to be safe to drop.

In the unlikely event that the user wants to use the untyped version, he can just resort to js.Dynamic.global.setTimeout().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions