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

export const Database = createSlice({
  name: 'database',
  initialState: {
    value: initialState
  },
  reducers: {
    updateDatabase: (state, newState) => {
      state.value = newState.payload;
    },
  },
})

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

export default Database.reducer