Skip to content

Commit f5c2f17

Browse files
committed
refactor store to implement DashboardStore for improved state management of entity and user details
1 parent 31abdec commit f5c2f17

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

config/store.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,22 @@ export const useIsNavigating = create<NavigationProps>((set) => ({
1111
setIsNavigation: (isNavigating) => set({ isNavigating }),
1212
}));
1313

14+
interface DashboardStore {
15+
entityDetails: any;
16+
userDetails: any;
17+
setEntityDetails: (data: any) => void;
18+
setUserDetails: (data: any) => void;
19+
allEntityDetails: any;
20+
setAllEntityDetails: (data: any) => void;
21+
}
22+
23+
export const useDashboardStore = create<DashboardStore>((set) => ({
24+
entityDetails: null,
25+
userDetails: null,
26+
setEntityDetails: (data) => set({ entityDetails: data }),
27+
setUserDetails: (data) => set({ userDetails: data }),
28+
allEntityDetails: null,
29+
setAllEntityDetails: (data) => set({ allEntityDetails: data }),
30+
}));
31+
1432
export { shallow };

0 commit comments

Comments
 (0)