@oasis-cloud/countdown
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

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()

Readme

Keywords

Package Sidebar

Install

npm i @oasis-cloud/countdown

Weekly Downloads

0

Version

0.0.1

License

ISC

Unpacked Size

13.5 kB

Total Files

10

Last publish

Collaborators

  • oasis-labs