UNPKG

mongodb-chatbot-ui

Version:

UI React components for the MongoDB Assistant

21 lines (20 loc) 517 B
import n, { useContext as s } from "react"; import { b as r } from "./ConversationStateProvider2.js"; import "react/jsx-runtime"; import "./utils.js"; const u = (t) => t; function a(t, e = u) { const o = n.useSyncExternalStore( t.subscribe, n.useCallback(() => e(t.getState()), [t, e]), n.useCallback(() => e(t.getInitialState()), [t, e]) ); return n.useDebugValue(o), o; } function b() { const t = s(r), e = a(t); return { store: t, state: e }; } export { b as useConversationStateContext };