Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saber2pr/schedular
> 基于 requestIdleCallback 的优先级调度
https://github.com/saber2pr/schedular
requestidlecallback schedular
Last synced: 27 days ago
JSON representation
> 基于 requestIdleCallback 的优先级调度
- Host: GitHub
- URL: https://github.com/saber2pr/schedular
- Owner: Saber2pr
- Created: 2019-05-06T04:29:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-13T07:28:34.000Z (over 5 years ago)
- Last Synced: 2024-10-10T20:03:57.449Z (27 days ago)
- Topics: requestidlecallback, schedular
- Language: TypeScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @saber2pr/schedular
[![npm](https://img.shields.io/npm/v/@saber2pr/schedular.svg?color=blue)](https://www.npmjs.com/package/@saber2pr/schedular)
> 基于 requestIdleCallback 的优先级调度
```bash
# from npm
npm install @saber2pr/schedular# from github
git clone https://github.com/Saber2pr/-saber2pr-schedular.git
```## API
```ts
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
```bash
npm install
``````bash
npm startnpm 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!