From c49b98966efac05c17c4d3605e6353e1df5b9f0a Mon Sep 17 00:00:00 2001 From: David Katz <15Dkatz@shcp.edu> Date: Fri, 21 Oct 2022 15:55:47 -0700 Subject: [PATCH] Reducers --- evens-or-odds/src/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/evens-or-odds/src/index.js b/evens-or-odds/src/index.js index 8d363c8..39abf09 100644 --- a/evens-or-odds/src/index.js +++ b/evens-or-odds/src/index.js @@ -4,12 +4,20 @@ import { configureStore } from '@reduxjs/toolkit'; import App from './components/App'; import './index.css'; +const DEFAULT_SETTINGS = { + gameStarted: false, + instructionsExpanded: false +}; + const rootReducer = () => { - return { foo: 'bar' }; + return DEFAULT_SETTINGS; }; -const store = configureStore(); +const store = configureStore({ + reducer: rootReducer +}); console.log('store', store); +console.log('store.getState()', store.getState()); const root = ReactDOM.createRoot(document.getElementById('root')); root.render();