import { createSlice } from '@reduxjs/toolkit';
import initialState from './global.json';

export const Global = createSlice({
  name: 'global',
  initialState: {
    value: initialState
  },
  reducers: {
    updateGlobal: (state, newState) => {
      state.value = newState.payload;
    },
  },
})

// Action creators are generated for each case reducer function
export const { updateGlobal } = Global.actions

export default Global.reducer