Skip to content

> 基于 requestIdleCallback 的优先级调度

Notifications You must be signed in to change notification settings

Saber2pr/schedular

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@saber2pr/schedular

npm

基于 requestIdleCallback 的优先级调度

# from npm
npm install @saber2pr/schedular

# from github
git clone https://github.com/Saber2pr/-saber2pr-schedular.git

API

import VM from '@saber2pr/schedular'

new VM()
  .push({
    expirationTime: 40,
    idleCallback: () => console.log('low priority')
  })
  .push({
    expirationTime: 25,
    idleCallback: () => console.log('common priority')
  })
  .push(() => console.log('high priority')) // expirationTime: 0

start

npm install
npm start

npm run dev

Author: saber2pr


develope and test

you should write ts in /src

you should make test in /src/test

export your core in /src/index.ts!

About

> 基于 requestIdleCallback 的优先级调度

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published