mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-09-19 09:40:13 +00:00
* implement group page * group state, search box * rename some field * update api types
17 lines
476 B
TypeScript
17 lines
476 B
TypeScript
import { MainStore } from '@/types'
|
|
import { create } from 'zustand'
|
|
import { persist, createJSONStorage } from 'zustand/middleware'
|
|
|
|
export const useMainStore = create<MainStore, [['zustand/persist', MainStore]]>(
|
|
persist(
|
|
(set, get) => ({
|
|
profile: get()?.profile,
|
|
setProfile: profile => set({ profile }),
|
|
}),
|
|
{
|
|
name: 'mainStore',
|
|
storage: createJSONStorage(() => localStorage),
|
|
},
|
|
),
|
|
)
|