优化
This commit is contained in:
17
client/shared/store/globalConfig.ts
Normal file
17
client/shared/store/globalConfig.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
import type { GlobalConfig } from '../model/config';
|
||||
import { defaultGlobalConfig } from '../utils/consts';
|
||||
|
||||
type GlobalConfigState = GlobalConfig;
|
||||
|
||||
export const useGlobalConfigStore = create<GlobalConfigState>()(
|
||||
persist(
|
||||
(set) => ({
|
||||
...defaultGlobalConfig,
|
||||
}),
|
||||
{
|
||||
name: 'globalConfigStore',
|
||||
}
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user