Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Redux Fundamentals - Tonida Baraza

Redux Fundamentals - Tonida Baraza

More Decks by Developer Circles: Nairobi

Other Decks in Programming

Transcript

  1. 3 core principles of redux • State of an entire

    application, is contained in a single object called the state or the state tree. • The state tree is immutable. The only way to change it is by dispatching an action. • To describe state mutations, you require a reducer.
  2. Store methods • getState - It retrieves the current state

    • dispatch - It lets you dispatch actions to change the state of your application • subscribe - It lets you register a callback that the Redux store will call any time an action has been dispatched
  3. When to use redux • User workflows are complex •

    You’re loading data from multiple endpoints to build a single view • Your app has a large variety of user workflows (consider both regular users and administrators) • Organisation
  4. Benefits of redux • Predictability of outcome • Maintainability •

    Developer tools • Ease of testing • Community