The Complete Redux Book

How do I manage a large state in production? Why do I need store enhancers? How do I test middleware? Get the answers t

417 271 959KB

English Pages 179 Year 2017

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Table of Contents......Page 4
Should I Read This Book?......Page 7
How to Read This Book......Page 8
Acknowledgements......Page 9
Code Repository......Page 10
Part 1. Introduction to Redux......Page 11
What Is Flux?......Page 12
Redux and Flux......Page 14
Redux Terminology......Page 15
General Concepts......Page 18
Redux and React......Page 20
Basic Redux Implementation......Page 21
Summary......Page 28
Starter Project......Page 29
Our First Application......Page 31
Setting Up the Store......Page 33
Adding Recipes......Page 34
Adding Ingredients......Page 36
A Closer Look at Reducers......Page 37
Handling Typos and Duplicates......Page 39
Simple UI......Page 40
Logging......Page 42
Getting Data from the Server......Page 43
Summary......Page 46
Part 2. Real World Usage......Page 47
The Concept of Separation......Page 48
State as a Database......Page 51
Keeping a Normalized State......Page 53
Persisting State......Page 56
Real-World State......Page 57
Summary......Page 59
Using Promises in Action Creators......Page 60
API Middleware......Page 61
Moving Code from Action Creators......Page 62
Using the API Middleware......Page 63
Error Handling......Page 64
Loading Indicator (Spinner)......Page 65
Dynamic Action Types......Page 66
More Extensions......Page 68
Chaining APIs......Page 69
Canceling API Requests......Page 73
Summary......Page 75
Redux Link......Page 76
Code Implementation......Page 77
Complete WebSocket Middleware Code......Page 82
Authentication......Page 83
Summary......Page 86
Test Files and Directories......Page 87
Testing Action Creators......Page 88
Async Action Creators......Page 92
Reducer Tests......Page 96
Testing Middleware......Page 104
Integration Tests......Page 113
Summary......Page 115
Part 3. Advanced Concepts......Page 116
Creating a Store......Page 117
Decorating the Store......Page 122
Summary......Page 129
Chapter 8. Actions and Action Creators......Page 130
Action Creators......Page 131
Flux Standard Actions......Page 133
String Constants......Page 135
Testing Action Creators......Page 137
redux-thunk......Page 138
redux-actions......Page 143
Summary......Page 148
Reducers in Practice......Page 149
Avoiding Mutations......Page 155
Ensuring Immutability......Page 161
Higher-Order Reducers......Page 163
Summary......Page 164
Chapter 10. Middleware......Page 165
Our First Middleware......Page 166
Async Actions......Page 168
Using Middleware for Flow Control......Page 171
Other Action Types......Page 173
Difference Between next() and dispatch()......Page 174
Parameter-Based Middleware......Page 175
How Are Middleware Used?......Page 176
Summary......Page 177
Useful Libraries......Page 178
Courses and Tutorials......Page 179

The Complete Redux Book

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Recommend Papers