@jayarjo/scheduler
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

scheduler

import { scheduler } from '@jayarjo/scheduler'

// run once in certain amount of time units (milliseconds by default)
scheduler.runIn(fn, 5000) // invoke fn in 5 secs

// run consequently with the specified interval
const taskId = scheduler.runEvery(fn, 1000) // invoke every second

// task can be removed if required after certain amount of time
setTimeout(() => {
  scheduler.removeTask(taskId)
}, 5000)

Readme

Keywords

none

Package Sidebar

Install

npm i @jayarjo/scheduler

Weekly Downloads

1

Version

1.1.3

License

MIT

Unpacked Size

28.8 kB

Total Files

16

Last publish

Collaborators

  • jayarjo