scrimba
Redux Fundamentals With React
Challenge: Reducers
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

Challenge: Reducers
AboutCommentsNotes
Challenge: Reducers
Expand for more info
store
index.js
run
preview
console
import { createStore } from 'redux'

// 1 - initialize a store called solarSystem (object)
// 2 - add the following 3 properties:
// 2a - star set to the string 'sun'
// 2b - planets set to an empty array
// 2c - constellationsVisible set to 2 properties:
// 2d - orion set to false
// 2e - pegasus set to true

// 3 - write a reducer function, passing to it the store you
// initialized in step 1

const store = createStore(reducer)

export default store

Console
index.html
-2:05