zustand-middleware-yjs
Version:
Zustand middleware for syncing state with Yjs.
6 lines (5 loc) • 350 B
TypeScript
import * as Y from "yjs";
import { StoreApi } from "zustand/vanilla";
export declare const patchSharedType: (sharedType: Y.Map<any> | Y.Array<any> | Y.Text, newState: any) => void;
export declare const patchState: (oldState: any, newState: any) => any;
export declare const patchStore: <S extends unknown>(store: StoreApi<S>, newState: any) => void;