Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 1.41 KB

File metadata and controls

34 lines (27 loc) · 1.41 KB

Redux - Combined Reducers

Review, Research, and Discussion

  1. Why choose Redux instead of the Context API for global state?

    • Redux dev tools make debuggin easier
    • Redux requires more setup, but is easier to extend with new data and actions after that setup is in place
    • UI and state management logic are separated in redux
    • source: dev.to
  2. What is the purpose of a reducer?

    • a function that takes in state and produces a new state
    • source: pluralsight.com
  3. What does an action contain?

    • JS objects with a type field
    • describe something that happened in the application
    • source: redux.js.org
  4. Why do we need to copy the state in a reducer?

    • becuase state is immutable, so we need to create a new object to create a new state

Vocabulary Terms

  • immutable state
    • state that cannot be mutated
    • a new object will need to be created to 'update' the original state
  • time travel in redux
  • action creator
  • reducer
    • a function used to update immutible state by creating a new object
  • dispatch