# scheduling

> A enterframe tool

Latest version **1.4.4** (published 2024-12-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install scheduling
pnpm add scheduling
yarn add scheduling
bun add scheduling
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.4 |
| Published | 2024-12-18 |
| First published | 2016-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 46.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Yi-Wen Lin |
| Maintainers | yiwenl |
| Keywords | enterframe, loop |

## Links

- npm: https://www.npmjs.com/package/scheduling
- Repository: https://github.com/yiwenl/Scheduler
- Homepage: https://github.com/yiwenl/Scheduler#readme
- Issues: https://github.com/yiwenl/Scheduler/issues
- npm.io page: https://npm.io/package/scheduling

## Recent versions

- 1.4.4 (latest) — 2024-12-18
- 1.4.3 — 2024-11-14
- 1.4.2 — 2024-11-14
- 1.4.1 — 2024-09-25
- 1.4.0 — 2024-09-25
- 1.3.5 — 2021-06-05
- 1.3.4 — 2021-04-12
- 1.3.3 — 2021-03-20
- 1.3.2 — 2021-02-13
- 1.3.1 — 2021-02-13
- 1.3.0 — 2021-02-13
- 1.2.0 — 2018-12-06
- 1.1.1 — 2017-10-02
- 1.1.0 — 2017-09-21
- 1.0.6 — 2017-09-19
- … 6 more at https://npm.io/package/scheduling/versions

## README

# Scheduler
A simple javascript tool for enterframe tasks.

## Installation
```npm install scheduling```

## Usage 
### Adding enterframe task : 
```
import Scheduler from 'scheduling';
let enterframeID = Scheduler.addEF(loop);

function loop() {
    ...
}
```

### Remove enterframe task : 
```
Scheduler.removeEF(enterframeID);
```

### Delay call
```
Scheduler.delay(delayFunc, 'hello', 500);
function delayFunc(mStr) {
    console.log(mStr);  //  console output 'hello'
}
```

### Calling in the next frame : 
```
checkLoaded();

function checkLoaded() {
    if(!loaded) {
        Scheduler.next(checkLoaded);
        return;
    }
    
    ... //  loaded
}
```


### Green threading
```
Scheduler.defer(func, [params]);
```

---
_Source: https://npm.io/package/scheduling · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
