https://github.com/aleclarson/flush-microtasks
Know when the microtask queue is empty
https://github.com/aleclarson/flush-microtasks
microtasks testing
Last synced: 4 months ago
JSON representation
Know when the microtask queue is empty
- Host: GitHub
- URL: https://github.com/aleclarson/flush-microtasks
- Owner: aleclarson
- Created: 2019-12-08T17:09:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-08T17:34:09.000Z (over 5 years ago)
- Last Synced: 2025-01-18T02:16:44.329Z (6 months ago)
- Topics: microtasks, testing
- Language: TypeScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# flush-microtasks
Return a thenable that resolves when the microtask queue is empty.
Taken from [enqueueTask.js](https://github.com/facebook/react/blob/b43eec7eaad14747d24ef24a06b27cb2a5653bbc/packages/shared/enqueueTask.js) in React.
```ts
import { flushMicroTasks } from 'flush-microtasks'await flushMicroTasks()
```