Function: createSyncHandler()
このコンテンツはまだ日本語訳がありません。
Function: createSyncHandler()
Section titled “Function: createSyncHandler()”createSyncHandler<
S,TCtx>(options): (request) =>Promise<Response>
Defined in: server/src/sync-handler.ts:357
Build a fetch-compatible handler that services /push and /pull under
basePath (default /sync). Wire it into your Worker’s default export.
The push side is idempotent per (clientGroupID, clientID, mutation.id):
a repeated push of the same mutation is dropped by the last_mutation_id
check. A mutation that throws still advances the id (in a separate tx) so
the client is never stuck in an infinite retry loop.
Type Parameters
Section titled “Type Parameters”S extends Record<string, AnyTable>
TCtx
Parameters
Section titled “Parameters”options
Section titled “options”SyncHandlerOptions<S, TCtx>
Returns
Section titled “Returns”(request) => Promise<Response>