Mosh Redux part 1 (Introduction)

Redux is a state management library for JS apps

But why?

Keep different parts of the UI in sync.

Data flow one part to another and change. We need to write code to keep everything in sync. How data change? etc. Such issues shows that we need a state management library.

Instead of scattering all app state in various parts of the UI, we store inside a single source of truth. “Database for the Frontend”.

Solves problem of sync-ing data across the UI app.

  • Centralizes application’s state
  • Makes data flow transparent and predictable

Pros

Centralized state across UI
Predictable state changes
Easy debugging via Time travel debugging
Preserve page state
Undo/redo via Log Rocket

Con

Complexity
Verbosity