Redux in Action
Marc Garreau and Will Faurot
  • MEAP began June 2017
  • Publication in Spring 2018 (estimated)
  • ISBN 9781617294976
  • 325 pages (estimated)
  • printed in black & white

The "state" of a typical web application - the representation of its data at any given time - is stored in multiple data stores that must be individually monitored and maintained. The Redux JavaScript library consolidates state in a single object, radically simplifying one of the largest sources of bugs. Whether you're passing data through several layers of components or sharing and syncing data between unrelated parts of the app, Redux makes state management a breeze. Redux promotes predictability, testability, and the ability to debug your dynamic applications, letting you focus on building great apps. Redux is most closely associated with React.js, although you can use it with just about any framework, including Angular, Backbone, and Vue.js.

With Redux in Action, you'll discover how to integrate Redux into your React application and development environment. Starting by building a basic task management application, you'll dive into the Redux workflow, asynchronous actions, and the Redux developer tools. As you move through the practical examples inside, you'll also learn how to prepare data for components, write custom middleware, and optimize for performance. With the insights you glean from the experience of authors Marc Garreau and Will Faurot, you'll be more than confident in your ability to solve your state management woes with Redux, and focus on developing the apps you need to!

Table of Contents detailed table of contents

1. Introducing Redux

1.1. What is state?

1.2. What is Flux?

1.2.1. Actions

1.2.2. Dispatcher

1.2.3. Stores

1.2.4. Views

1.3. What is Redux?

1.3.1. React and Redux

1.3.2. The Three Principles

1.3.3. The Workflow

1.4. Why Should I Use Redux?

1.4.1. Predictability

1.4.2. Developer Experience

1.4.3. Testability

1.4.4. Learning Curve

1.4.5. Size

1.5. When Should I Use Redux?

1.6. Alternatives to Redux

1.6.1. Flux Implementations

1.6.2. MobX

1.6.3. GraphQL Clients

1.7. Summary

2. Your first Redux application

2.1. Building a Task Management Application

2.1.1. Designing the state shape

2.2. Using Create React App

2.2.1. Installing Create React App

2.3. Basic React Components

2.4. Revisiting the Redux architecture

2.5. Configuring the Redux store

2.5.1. The big picture and the store API

2.5.2. Creating a Redux store

2.5.3. The tasks reducer

2.5.4. Default reducer state

2.6. Connecting Redux and React with react-redux

2.6.1. Adding the Provider component

2.6.2. Passing data from Redux to React components

2.6.3. Container and presentational components

2.7. Dispatching Actions

2.8. Action Creators

2.8.1. Dispatching action creators

2.8.2. Action creators and side-effects

2.9. Handling actions with reducers

2.9.1. Responding to actions in reducers

2.10. Putting it all together

2.10.1. Planning the feature

2.10.2. The status dropdown

2.10.3. Dispatching an edit action

2.10.4. Handling the action in a reducer

2.11. Summary

3. Debugging Redux applications

3.1. Introducing the Redux DevTools

3.2. Time-travel debugging

3.3. Visualizing changes with DevTools monitors

3.4. Implementing the Redux DevTools

3.5. The role of Webpack

3.6. Hot module replacement

3.6.1. Hot-loading components

3.6.2. Hot-loading reducers

3.6.3. Limitations of hot module replacement

3.7. Preserving Local State with React Hot Loader

3.8. Summary

4. Consuming an API

5. Deep dive into middleware

6. Handling side-effects

7. Preparing data for components

8. Normalizing data

9. Testing Redux applications

10. Performance

11. Structuring Redux code

12. Redux beyond React

What's inside

  • Building with Redux and React
  • Writing custom Redux middleware
  • Handling complex side-effects using sagas
  • Enforcing data integrity by normalizing data
  • Unit testing a React and Redux application

About the reader

Written for web developers comfortable with JavaScript and ES6, as well as experience using React.

About the authors

Marc Garreau has architected and executed half a dozen unique client-side applications leveraging Redux for state management. Will Faurot is experienced in equal parts production Redux, and mentoring Redux developers of all skill levels.


Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
Buy
MEAP combo $44.99 pBook + eBook
MEAP eBook $35.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks