Skip to content

Commit 4282c4b

Browse files
Remove node from sleep util (#2499)
## Checklist - [/] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [/] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [/] I have not broken the cheatsheet --------- Co-authored-by: Pokey Rule <[email protected]>
1 parent 21f7525 commit 4282c4b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/common/src/util/sleep.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { promisify } from "util";
2-
31
/**
42
* Sleep function that returns a promise that resolves when the sleep is
53
* complete.
@@ -8,6 +6,6 @@ import { promisify } from "util";
86
* on failure, and this function will sleep the same amount of time every time
97
* the test is retried. Prefer {@link sleepWithBackoff} instead.
108
*/
11-
const sleep = promisify(setTimeout);
12-
13-
export default sleep;
9+
export default function sleep(ms: number): Promise<void> {
10+
return new Promise((resolve) => setTimeout(resolve, ms));
11+
}

0 commit comments

Comments
 (0)