reading-notes

Reading Notes

View the Project on GitHub simon-panek/reading-notes

Code 401: Class 37 - Redux - Combined Reducers


Questions

  1. Why choose Redux instead of the Context API for global state? The jury seems to be out on this question, many examples online point to either one as being the better choice or in some cases they should be used together. Context appears to be the better option when dealing the static data like theme selection while Redux is often better for storing global state data that is more dynamic.

  2. What is the purpose of a reducer? A function that determines the changes to an applications state, uses the action to determine the change

  3. What does an action contain? Actions are the only way to updated data in the store. Must include a type and can pass a payload containing data

  4. Why do we need to copy the state in a reducer? Data in the store is immutable, so to make changes a copy must be made in the reducer so that it can be changed

Vocabulary

Watch: Multiple Reducers Example

Read: Redux Docs: Using Combined Reducers

Read: Redux Docs: Combined Reducer Syntax


Return to reading-notes Deployed Site

Return to reading-notes Mark Down