Skip to content
Source
Sign inSign up
fuko/trytanstackdb.com

Add a panel for observing the API requests #29

Mergedfukomerged 24 commits intomain fromrefs/pull/29/headmerged by fuko View on GitHub

Showing 20 changed files with 104 additions and 32 deletions (loading 17).

x
0 of 20 viewed, 20 left
57 additions and 32 deletionssrc/client/pgliteHelpers.tsModified
View file
@@ -1,7 +1,7 @@
/** TODO: rename this file */
​
import { createIsomorphicFn } from "@tanstack/react-start";
-import z from "zod";
+import { apiRequestsCollection } from "@/collections/apiRequests";
import { client } from "@/db";
import { migrate } from "@/db/migrate";
import { seed } from "@/db/seed";
@@ -12,15 +12,11 @@
deconstructResponseFromHandler,
requestSchema,
} from "@/local-api/helpers";
+import {
+ API_LATENCY_LOCALSTORAGE_KEY,
+ apiLatencyInMsSchema,
+} from "@/utils/apiLatency";
​
-export const NETWORK_LATENCY_LOCALSTORAGE_KEY =
- "__TRYTANSTACKDB_API_DELAY_MS__";
-export const networkLatencyInMsSchema = z
- .string()
- .transform((t) => parseInt(t, 10))
- .default(1_000)
- .catch(1_000);
-​