What is the first principle of Redux?
What is a store and what do we use our reducers for within that store?
A store is a single JavaScript object that holds the state of your application. The store has a method called getState
that returns the current state value inside of it. The store also has a method called dispatch
that accepts an action object as its argument. The store also has a method called subscribe
that accepts a callback function that will be run every time an action is dispatched.
Reducers are functions that take the current state value and an action object as arguments, and return a new state result. In other words, (state, action) => newState.
Name three Redux store methods given to us by createStore
and describe their use.
getState
- returns the current state value inside of the store.dispatch
- accepts an action object as its argument.subscribe
- accepts a callback function that will be run every time an action is dispatched.Looking ahead at this module’s course schedule, what do you look forward to learning?
What are your learning goals after reading and reviewing the class README?