integration of zustand

This commit is contained in:
2023-04-04 23:31:21 -03:00
parent e5c37b9449
commit e7149f53ff
5 changed files with 30 additions and 17 deletions

16
lib/storage.ts Normal file
View File

@@ -0,0 +1,16 @@
/* eslint-disable @typescript-eslint/ban-types */
import { create } from 'zustand';
import { type Tab } from '@/lib/types';
import { SPEND_SCREEN_ID, SPEND_SCREEN_NAME } from '@/lib/constants';
interface appStore {
tab: Tab;
setTab: (props: Tab) => void;
}
export const useAppStore = create<appStore>((set) => ({
setTab: (props: Tab) => {
set(() => ({ tab: props }));
},
tab: { id: SPEND_SCREEN_ID, title: SPEND_SCREEN_NAME },
}));