Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aleclarson/flush-microtasks
Know when the microtask queue is empty
https://github.com/aleclarson/flush-microtasks
microtasks testing
Last synced: 19 days 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-08T17:34:09.000Z (almost 5 years ago)
- Last Synced: 2024-10-13T04:05:55.671Z (24 days 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()
```