-
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
-
What is the purpose of a reducer?
- a function that takes in state and produces a new state
- source: pluralsight.com
-
What does an action contain?
- JS objects with a type field
- describe something that happened in the application
- source: redux.js.org
-
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
- immutable state
- state that cannot be mutated
- a new object will need to be created to 'update' the original state
- time travel in redux
- Redux time travel keeps track of slices of state
- source: https://www.npmjs.com/package/redux-time-travel
- action creator
- reducer
- a function used to update immutible state by creating a new object
- dispatch