Skip to content

Commit

Permalink
6b: Many Reducers - Redux DevTools
Browse files Browse the repository at this point in the history
  • Loading branch information
jasylwong committed Jul 16, 2020
1 parent d72e265 commit 00625cc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
6 changes: 6 additions & 0 deletions part6/notes-redux/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion part6/notes-redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
]
},
"devDependencies": {
"deep-freeze": "0.0.1"
"deep-freeze": "0.0.1",
"redux-devtools-extension": "^2.13.8"
}
}
16 changes: 6 additions & 10 deletions part6/notes-redux/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, combineReducers } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'
import { Provider } from 'react-redux'
import App from './App'

Expand All @@ -9,24 +10,19 @@ import filterReducer from './reducers/filterReducer'

import './App.css';

// import { createNote } from './reducers/noteReducer'
// import { filterChange } from './reducers/filterReducer'

const reducer = combineReducers({
notes: noteReducer,
filter: filterReducer
})

const store = createStore(reducer)
const store = createStore(
reducer,
composeWithDevTools()
)

ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root')
)

console.log(store.getState())
// store.subscribe(() => console.log(store.getState()))
// store.dispatch(createNote('combineReducers forms one reducer from many simple reducers'))
// store.dispatch(filterChange('IMPORTANT'))
)

0 comments on commit 00625cc

Please sign in to comment.