scrimba
Redux Fundamentals With React
Redux DevTools
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Redux DevTools
AboutCommentsNotes
Redux DevTools
Expand for more info
store
index.js
run
preview
console
import { createStore } from 'redux'

const house = {
type: 'condo',
rooms: [
{id: 1, type: 'Living Room'},
{id: 2, type: 'Dining Room'},
{id: 3, type: 'Bathroom'}
],
doorsOpen: {
backDoor: false,
frontDoor: true
}
}

const reducer = (state = house, action) => {
if (action.type === 'ADD_ROOM') {
return Object.assign({}, state, {
rooms: state.rooms.concat(action.payload)
})
}
return state
}

// const store = createStore(reducer)

const store = createStore(
reducer,
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
)

export default store
Console
/index.html
-1:59