- initial;
This commit is contained in:
20
src/store/index.js
Normal file
20
src/store/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { mapValuesKey } from 'zustand-x';
|
||||
|
||||
// stores
|
||||
import { mainStore } from './main';
|
||||
|
||||
// Global store - initial data
|
||||
const dashboardStore = {
|
||||
main: mainStore
|
||||
};
|
||||
|
||||
// Global hook selectors
|
||||
export const useStore = () => mapValuesKey('use', dashboardStore);
|
||||
// Global tracked hook selectors
|
||||
export const useTrackedStore = () => mapValuesKey('useTracked', dashboardStore);
|
||||
// Global getter selectors
|
||||
export const storeGet = mapValuesKey('get', dashboardStore);
|
||||
// Global actions
|
||||
export const storeSet = mapValuesKey('set', dashboardStore);
|
||||
|
||||
export default dashboardStore;
|
||||
Reference in New Issue
Block a user