15 lines
355 B
TypeScript
15 lines
355 B
TypeScript
import { create } from 'zustand';
|
|
|
|
type NotifyState = {
|
|
hasNew: boolean;
|
|
setHasNew: (hasNew: boolean) => void;
|
|
};
|
|
|
|
const useNotificationStore = create<NotifyState>((set) => ({
|
|
hasNew: false,
|
|
setHasNew: (hasNew: boolean) => set({ hasNew }),
|
|
toggleNew: () => set((state) => ({ hasNew: !state.hasNew })),
|
|
}));
|
|
|
|
export default useNotificationStore;
|