1
0
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:
Sebastian Malton 2023-03-10 11:14:21 -05:00
parent 8cf42525e9
commit 008b990e57

View File

@ -2,6 +2,9 @@
* Copyright (c) OpenLens Authors. All rights reserved.
* 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);
};