[TOC]

Redux入门

Redux is a predictable state container for JavaScript apps.
Redux是Javascript应用程序的可预测状态容器。

It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as live code editing combined with a time traveling debugger.
它帮助你写表现一致的应用程序,在不同的环境中运行(客户端,服务器和原生),而且易于测试。它提供很棒的开发体验,例如实时代码编辑与时间旅行调试器结合使用。

You can use Redux together with React, or with any other view library. It is tiny (2kB, including dependencies), but has a large ecosystem of addons available.
你能用Redux和React一起使用,或者和其他视图库。它很迷你(2kB,包含依赖),但拥有大量可用插件生态系统。**

Installation

Redux is available as a package on NPM for use with a module bundler or in a Node application:
Redux作为一个NPM包,可以和模块捆绑器一起用,或者在用在Node应用程序

# NPM
npm install redux

# Yarn
yarn add redux

It is also available as a precompiled UMD package that defines a window.Redux global variable. The UMD package can be used as a