vega-frontend-monorepo/apps/trading/stores/global.ts
2022-09-05 15:25:33 +01:00

22 lines
501 B
TypeScript

import create from 'zustand';
interface GlobalStore {
connectDialog: boolean;
networkSwitcherDialog: boolean;
landingDialog: boolean;
riskNoticeDialog: boolean;
marketId: string | null;
update: (store: Partial<Omit<GlobalStore, 'update'>>) => void;
}
export const useGlobalStore = create<GlobalStore>((set) => ({
connectDialog: false,
networkSwitcherDialog: false,
landingDialog: false,
riskNoticeDialog: false,
marketId: null,
update: (state) => {
set(state);
},
}));