Skip to content

Events are triggered 6 times in the browser #19

@enc0ded

Description

@enc0ded

Each on event gets triggered exactly 6 times for one timer.

import Timer from 'tiny-timer'
const timer = new Timer({ interval: 1000, stopwatch: false })
timer.on('statusChanged', (status) => { console.log(status, Math.random()) })
timer.start(12000)

result:

running 0.2440708450748057
running 0.34142709021610296
running 0.6499113810642303
running 0.8082136213201725
running 0.43492532140397766
running 0.6325079204326065
stopped 0.10928056634093375
stopped 0.8905471982134121
stopped 0.37517316268358103
stopped 0.2731666295435524
stopped 0.9399286310551669
stopped 0.830340903702175

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions