Book Image

Learning Redux

By : Daniel Bugl
Book Image

Learning Redux

By: Daniel Bugl

Overview of this book

The book starts with a short introduction to the principles and the ecosystem of Redux, then moves on to show how to implement the basic elements of Redux and put them together. Afterward, you are going to learn how to integrate Redux with other frameworks, such as React and Angular. Along the way, you are going to develop a blog application. To practice developing growing applications with Redux, we are going to start from nothing and keep adding features to our application throughout the book. You are going to learn how to integrate and use Redux DevTools to debug applications, and access external APIs with Redux. You are also going to get acquainted with writing tests for all elements of a Redux application. Furthermore, we are going to cover important concepts in web development, such as routing, user authentication, and communication with a backend server After explaining how to use Redux and how powerful its ecosystem can be, the book teaches you how to make your own abstractions on top of Redux, such as higher-order reducers and middleware. By the end of the book, you are going to be able to develop and maintain Redux applications with ease. In addition to learning about Redux, you are going be familiar with its ecosystem, and learn a lot about JavaScript itself, including best practices and patterns.
Table of Contents (13 chapters)

What this book covers

Chapter 1, Why Redux?, will teach you about the principles that make Redux special, and why Redux should be used in a project. It starts out with the motivation behind Redux (complexity of state management), then briefly covers how Redux works in practice and how certain restrictions allow us to write maintainable, predictable, consistent, and easy-to-test applications.

Chapter 2, Implementing the Elements of Redux, explains how to set up a project that is ready for Redux and the new JavaScript ES2015 syntax. Then, you are going to implement the basic elements of Redux and put a full Redux project together.

Chapter 3, Combining Redux with React, covers what React is and why it makes sense to use it. Then you will learn how to set up a project with React and connect Redux to it.

Chapter 4, Combining Redux with Angular, covers using Redux in combination with Angular 1 and 2+ (compatible with Angular 4).

Chapter 5, Debugging a Redux Application, covers how to integrate and use Redux DevTools in an application. Then it covers various Redux DevTools monitors, explaining how to configure and use them in practice.

Chapter 6, Interfacing with APIs, teaches you how to handle asynchronous operations with Redux. Afterwards, this knowledge is used to pull blog posts and users from an API into the Redux store. Finally, you are going to learn how to dispatch actions that change the state in the frontend/client and the backend/server (creating users and posts).

Chapter 7, User Authentication, explains token authentication is and why using it over traditional cookie/session ID authentication makes sense. Next, you will learn how to use and implement an open standard of token authentication--JSON Web Token (JWT).

Chapter 8, Testing, covers using Jest, a testing engine, to write tests for all the elements of Redux.

Chapter 9, Routing, covers how to implement routing with Redux and React, manually and by using libraries such as react-router and react-router-redux.

Chapter 10, Rendering on the Server, this chapter teaches you why server-rendering makes sense and what benefits we get from using this technique. Then, you are going to learn how to implement server-side rendering in a Redux/React application.

Chapter 11, Solving Generic Problems with Higher-Order Functions, explains about advanced patterns when developing JavaScript/Redux/React applications. It starts by teaching basic concepts such as pure functions, then moves on to higher-order functions. Next, you will learn how to use these concepts in a Redux/React application to implement generic undo/redo behavior.

Chapter 12, Extending the Redux Store via Middleware, teaches what middleware (specifically, Redux store middleware) is and how it can be used. To wrap up, this chapter ends with a section on general tips and tricks for developing Redux applications.