UNPKG

partysync

Version:

Experimental library to synchronize state between a Durable Object and client. See [design discussion](https://github.com/cloudflare/partykit/issues/147).

21 lines (19 loc) 442 B
import { WebSocket } from "partysocket"; //#region src/react/index.d.ts declare function useSync< RecordType extends unknown[], Action extends { type: string; payload: unknown; } >( key: string, socket: WebSocket, optimisticReducer?: ( currentState: RecordType[], action: Action ) => RecordType[] ): [RecordType[], (action: Action) => void]; //#endregion export { useSync }; //# sourceMappingURL=index.d.ts.map