mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
More consistent impl of flushPromises
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
8cf42525e9
commit
008b990e57
@ -2,6 +2,9 @@
|
|||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { setImmediate } from "timers";
|
import { setImmediate, setTimeout } from "timers/promises";
|
||||||
|
|
||||||
export const flushPromises = () => new Promise(setImmediate);
|
export const flushPromises = async () => {
|
||||||
|
await setImmediate();
|
||||||
|
await setTimeout(5);
|
||||||
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user