0.0.1 • Published 1 year ago

@oasis-cloud/countdown v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

countdown

The time countdown tool provides a countdown queue function, avoids opening multiple timers, and supports clearing a single countdown task. More efficient countdown.

Demo

  • Add countdown task
import countdown from '@oasis-cloud/countdown'

const [clearCountdown, addCountdown] = countdown()

const taskName = 'skill'

const taskParams = {
    remaining: 1000,
    unit: 'sec'
}

const task = (remaining) => {
    // do something
    console.log(remaining)
}
addCountdown(taskName, taskParams, task)
  • Clear countdown
// 仅仅清除 skill 任务
clearCountdown('skill')
// 清除全部任务
clearCountdown()
0.0.1

1 year ago