Skip to content
Source
Sign inSign up
fuko/trytanstackdb-v2

Deep dive: Neon Realtime sync (simulated) #5

Closedfukowants to merge 1 commit intophase-3-guide fromneon-realtime-deep-diveopened

Showing 17 changed files with 111 additions and 3 deletions (loading 13).

x
0 of 17 viewed, 17 left
2 additions and 1 deletionsrc/api/client.tsModified
View file
@@ -37,6 +37,7 @@
export const api = {
get: <T>(url: string, options?: { signal?: AbortSignal }) => request<T>("GET", url, options),
post: <T>(url: string, body: unknown) => request<T>("POST", url, { body }),
- patch: <T>(url: string, body: unknown) => request<T>("PATCH", url, { body }),
+ patch: <T>(url: string, body: unknown, options?: { signal?: AbortSignal }) =>
+ request<T>("PATCH", url, { body, ...options }),
delete: (url: string) => request<void>("DELETE", url),
};
23 additions and 2 deletionssrc/api/fake-fetch.tsModified
View file
@@ -2,6 +2,7 @@
import type { SeedData } from "@/fixtures";
​
import { createFakeServer, errorBody } from "./fake-server";
+import type { NotesCommit } from "./fake-server";
import { getNetworkConfig, takeInjectedFailure } from "./network-config";
import { logRequestEnd, logRequestStart } from "./request-log";
​
@@ -62,13 +63,33 @@