Stay foolish, stay hungry.

Overview of Redux

Posted on By 吴杰

FAQ Before Learning

When to learn

What to learn can be an overwhelming question for a JavaScript developer. It helps to narrow the range of options by learning one thing at a time and focusing on problems you find in your work. Redux is a pattern for managing application state. If you do not have problems with state management, you might find the benefits of Redux harder to understand. Some UI libraries (like React) have their own state management system. If you are using one of these libraries, especially if you are just learning to use them, we encourage you to learn the capabilities of that built-in system first. It might be all you need to build your application. If your application becomes so complex that you are confused about where state is stored or how state changes, then it is a good time to learn Redux. Experiencing the complexity that Redux seeks to abstract is the best preparation for effectively applying that abstraction to your work.

Redux是用来管理组件的状态的,在学习之前最好对其他相关的框架(比如React里面就有State管理)中的State有所了解。Redux关注的是组件状态的存储和更改。

When to use

In general, use Redux when you have reasonable amounts of data changing over time, you need a single source of truth, and you find that approaches like keeping everything in a top-level React component’s state are no longer sufficient.

需要一次更新大量数据的时候。

TO BE CONTINUED