mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-02-05 13:10:08 +00:00
implement notification page (#8)
This commit is contained in:
18
src/hooks/useNotificationStore.ts
Normal file
18
src/hooks/useNotificationStore.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { NotificationStore } from '@/types'
|
||||
import { create } from 'zustand'
|
||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||
|
||||
export const useNotificationStore = create<NotificationStore, [['zustand/persist', NotificationStore]]>(
|
||||
persist(
|
||||
(set, get) => ({
|
||||
notifiers: get()?.notifiers,
|
||||
notifierGroup: get()?.notifierGroup,
|
||||
setNotifier: notifiers => set({ notifiers }),
|
||||
setNotifierGroup: notifierGroup => set({ notifierGroup }),
|
||||
}),
|
||||
{
|
||||
name: 'notificationStore',
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
},
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user