More consistent impl of flushPromises

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-03-13 10:08:23 -04:00
1 parent 8cf42525e9
commit 008b990e57
1 file changed
+5 -2
@@ -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);
};