@indietabletop/appkit 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.ts CHANGED
@@ -28,6 +28,7 @@ export * from "./client.ts";
28
28
  export * from "./failureMessages.ts";
29
29
  export * from "./media.ts";
30
30
  export * from "./random.ts";
31
+ export * from "./sleep.ts";
31
32
  export * from "./structs.ts";
32
33
  export * from "./types.ts";
33
34
  export * from "./validations.ts";
package/lib/sleep.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Pause for the specified number of milliseconds.
3
+ *
4
+ * This function is useful for testing, or slowing down responses in cases
5
+ * where we want to wait for some short-lived cache to clear first.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * await sleep(2000) // Waits for 2s
10
+ * ```
11
+ */
12
+ export function sleep(ms: number) {
13
+ return new Promise((r) => setTimeout(r, ms));
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indietabletop/appkit",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "A collection of modules used in apps built by Indie Tabletop Club",
5
5
  "private": false,
6
6
  "type": "module",