tiny-timer icon indicating copy to clipboard operation
tiny-timer copied to clipboard

Events are triggered 6 times in the browser

Open enc0ded opened this issue 4 years ago • 2 comments

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

enc0ded avatar May 05 '21 05:05 enc0ded

Hi, I cannot reproduce this, did you use webpack or?

mathiasvr avatar May 05 '21 15:05 mathiasvr

I'm using NuxtJS which use webpack yes.

enc0ded avatar May 06 '21 00:05 enc0ded