@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.
19 lines (11 loc) • 605 B
text/typescript
'use client';
import { createContext } from 'zustand-utils';
import { subscribeWithSelector } from 'zustand/middleware';
import { shallow } from 'zustand/shallow';
import { createWithEqualityFn } from 'zustand/traditional';
import { StoreApiWithSelector } from '@/utils/zustand';
import { Store, store } from './action';
export type { State } from './initialState';
export const createStore = () => createWithEqualityFn(subscribeWithSelector(store), shallow);
export const { useStore, useStoreApi, Provider } = createContext<StoreApiWithSelector<Store>>();
export { selectors } from './selectors';