Skip to content

Commit

Permalink
✏️ move sections
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Nov 10, 2023
1 parent f970905 commit de68bf6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ async function findInFiles(query: string) {
}
```

#### `requestAfterFrame(callback)`

_This is a utility function, most people don't need to use it._ The same way `requestAnimationFrame()` queues a `callback` to be executed just before a frame is rendered `requestAfterFrame()` is called just after a frame is rendered.

#### `queueTask(callback)`

_This is a utility function, most people don't need to use it._ The same way `queueMicrotask()` queues a `callback` to be executed in the microtask queue `queueTask()` queues the task for the next task. You learn more at [here](https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide#tasks_vs._microtasks).

### More complex scenarios

The library has two more functions available:
Expand Down Expand Up @@ -113,14 +121,6 @@ There are two priorities available: `user-visible` and `background`:
- `user-visible` – use this for things that need to display to the user as fast as possible. Every `user-visible` task is run for 83ms – this gives you a nice cycle of doing heavy work and letting the browser render pending changes.
- `background` – use this for background tasks. Every background task is run for 5ms.

#### `requestAfterFrame(callback)`

This is a utility function, most people don't need to use it. The same way `requestAnimationFrame()` queues a `callback` to be executed just before a frame is rendered `requestAfterFrame()` is called just after a frame is rendered.

#### `queueTask(callback)`

This is a utility function, most people don't need to use it. The same way `queueMicrotask()` queues a `callback` to be executed in the microtask queue `queueTask()` queues the task for the next task. You learn more at [here](https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide#tasks_vs._microtasks).

## Alternatives

<div id="scheduler-yield-alternative"></div>
Expand Down

0 comments on commit de68bf6

Please sign in to comment.