Savepoint

This commit is contained in:
Dunemask 2022-05-17 12:32:04 +00:00
parent 7db1a3456b
commit 02c483950c
45 changed files with 5136 additions and 256 deletions

View file

@ -5,9 +5,18 @@ const ACTIONS = {
UPDATE: "u",
};
const initialState = {};
const initialState = {
intervals: [],
failing: [],
regions: [],
focusJob: false,
simplifiedControls: false,
defaultRegion: "us", // Local Store
defaultPage: "failing", // Local Store
};
const reducer = (state, action) => {
const { store } = action;
// Actions
switch (action.type) {
case ACTIONS.UPDATE:
@ -23,7 +32,7 @@ export const StoreProvider = ({ children }) => {
const context = {
state,
dispatch,
updateStore: (store) => dispatch(state, { type: ACTIONS.UPDATE, store }),
updateStore: (store) => dispatch({ type: ACTIONS.UPDATE, store }),
};
const contextValue = useMemo(() => context, [state, dispatch]);