UNPKG

general-assistant

Version:

General Assistant components

11 lines (10 loc) 554 B
import { create } from 'zustand'; import layoutStore from './layout'; import chatStore from './chat'; import sourceStore from './source'; import appConfigStore from './appConfig'; export const createZustandStore = () => create((set, get) => ({ init: (def, custom) => { set((state) => Object.assign({}, state, { defaultConfig: def, customConfig: custom }, { ...appConfigStore(def, custom, set, get) }, { ...chatStore(def, custom, set, get) }, { ...sourceStore(def, custom, set, get) }, { ...layoutStore(def, custom, set, get) })); }, }));