Files
cozsweet-frontend-nextjs/src/stores/chat/chat-flow-actions.ts
T

14 lines
476 B
TypeScript

import { assign as xAssign } from "xstate";
import type { ChatEvent } from "./chat-events";
import type { ChatState } from "./chat-state";
export type ChatActionArgs = { context: ChatState; event: ChatEvent };
export type ChatContextArgs = { context: ChatState };
export const chatAssign = (
assignment: Parameters<
typeof xAssign<ChatState, ChatEvent, undefined, ChatEvent, never>
>[0],
) => xAssign<ChatState, ChatEvent, undefined, ChatEvent, never>(assignment);