Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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()
```