UNPKG

@n1ru4l/graphql-live-query-patch

Version:

Shared logic for building live query patch implementations.

7 lines (6 loc) 549 B
import { Repeater } from "@repeaterjs/repeater"; export declare type ApplyPatchFunction<PatchPayload = unknown> = (previous: Record<string, unknown>, patch: PatchPayload) => Record<string, unknown>; /** * Create a middleware generator function for applying live query patches on the client. */ export declare const createApplyLiveQueryPatch: <PatchPayload = unknown>(applyPatch: ApplyPatchFunction<PatchPayload>) => <TExecutionResult = Record<string, unknown>>(source: AsyncIterable<TExecutionResult>) => Repeater<TExecutionResult, any, unknown>;