@pvorona/scheduling
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Task scheduling

import { scheduleTask, PRIORITY } from '@pvorona/scheduling'

let windowWidth: number | undefined

scheduleTask(() => {
  windowWidth = window.innerWidth
}, PRIORITIES.READ)

scheduleTask(() => {
  document.body.innerText = `Window width is ${windowWidth}px`
}, PRIORITIES.WRITE)

// Window width is 900px

Tasks are scheduled to be executed before the next animation frame. Execution order is based on the priority: READ, COMPUTE, WRITE, FUTURE.

Readme

Keywords

Package Sidebar

Install

npm i @pvorona/scheduling

Weekly Downloads

0

Version

0.0.3

License

ISC

Unpacked Size

15.9 kB

Total Files

30

Last publish

Collaborators

  • pvorona