UNPKG

@lobehub/chat

Version:

Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.

21 lines (14 loc) 793 B
import { shallow } from 'zustand/shallow'; import { createWithEqualityFn } from 'zustand/traditional'; import { StateCreator } from 'zustand/vanilla'; import { createDevtools } from '../middleware/createDevtools'; import { MentionAction, createMentionSlice } from './action'; import { MentionState, initialMentionState } from './initialState'; export type MentionStore = MentionState & MentionAction; const createStore: StateCreator<MentionStore, [['zustand/devtools', never]]> = (...parameters) => ({ ...initialMentionState, ...createMentionSlice(...parameters), }); const devtools = createDevtools('mention'); export const useMentionStore = createWithEqualityFn<MentionStore>()(devtools(createStore), shallow); export const getMentionStoreState = () => useMentionStore.getState();