UNPKG

@assistant-ui/react

Version:

Typescript/React library for AI Chat

8 lines (5 loc) 237 B
import type { StoreApi } from "zustand"; export type ReadonlyStore<T> = Omit<StoreApi<T>, "setState" | "destroy">; export const writableStore = <T>(store: ReadonlyStore<T> | undefined) => { return store as unknown as StoreApi<T>; };