diff --git a/03-front-end-libraries/redux.json b/03-front-end-libraries/redux.json
index 831f8c1..eab5052 100644
--- a/03-front-end-libraries/redux.json
+++ b/03-front-end-libraries/redux.json
@@ -14,16 +14,16 @@
"challenges": [
{
"id": "5a24c314108439a4d403614b",
- "title": "Create a Redux Store",
+ "title": "创建一个 Redux Store",
"releasedOn": "December 25, 2017",
"description": [
- "Redux is a state management framework that can be used with a number of different web technologies, including React.",
- "In Redux, there is a single state object that's responsible for the entire state of your application. This means if you had a React app with ten components, and each component had its own local state, the entire state of your app would be defined by a single state object housed in the Redux store
. This is the first important principle to understand when learning Redux: the Redux store is the single source of truth when it comes to application state.",
- "This also means that any time any piece of your app wants to update state, it must do so through the Redux store. The unidirectional data flow makes it easier to track state management in your app.",
- "
store
is an object which holds and manages application state
. There is a method called createStore()
on the Redux object, which you use to create the Redux store
. This method takes a reducer
function as a required argument. The reducer
function is covered in a later challenge, and is already defined for you in the code editor. It simply takes state
as an argument and returns state
.",
- "Declare a store
variable and assign it to the createStore()
method, passing in the reducer
as an argument.",
- "Note: The code in the editor uses ES6 default argument syntax to initialize this state to hold a value of 5
. If you're not familiar with default arguments, you can refer to the ES6 section in the Beta Curriculum which covers this topic."
+ "Redux是一个状态管理框架,可以与包括React在内的许多不同的Web技术一起使用"
+ "在Redux中,有一个状态对象负责应用程序的整个状态, 这意味着如果你有一个包含十个组件且每个组件都有自己的本地状态的React项目,那么这个项目的整个状态将通过Redux store code>被定义为单个状态对象, 这是学习Redux时要理解的第一个重要原则:Redux存储是应用程序状态的唯一真实来源",
+ "这也意味着,如果你的应用程序想要更新状态,只能通过Redux store执行,单向数据流可以更轻松地对应用程序中的状态进行监测管理",
+
+ "“Redux store code>是一个保存和管理应用程序状态的 state code>,你可以Redux对象中的 createStore() code>来创建一个 redux store code>. 此方法将 reducer code>函数作为必需参数, reducer code>函数将在后面的挑战中介绍,该函数已在代码编辑器中为您定义。它只需将 state code>作为参数并返回一个 state code>即可",
+ "声明一个 store code>变量并把它分配给 createStore() code>方法,然后把 reducer code>作为一个参数传入即可",
+ "注意: 编辑器中的代码使用ES6默认参数语法初始化此状态以保存 5 code>的值. 如果你不熟悉默认参数,,你可以参考 ES6课程,它里面涵盖了这个内容"
],
"files": {
"indexjsx": {
@@ -35,9 +35,9 @@
" return state;",
"}",
"",
- "// Redux methods are available from a Redux object",
- "// For example: Redux.createStore()",
- "// Define the store here:",
+ "// Redux方法可以从Redux对象获得",
+ "// 例如: Redux.createStore()",
+ "// 在这里定义一个store:",
"",
""
],
@@ -47,16 +47,16 @@
},
"tests": [
{
- "text": "The redux store exists.",
- "testString": "assert(typeof store.getState === 'function', 'The redux store exists.');"
+ "text": "redux store 已经存在",
+ "testString": "assert(typeof store.getState === 'function', 'redux store 已经存在');"
},
{
- "text": "The redux store has a value of 5 for the state.",
- "testString": "assert(store.getState()=== 5, 'The redux store has a value of 5 for the state.');"
+ "text": "redux store的state的值为5",
+ "testString": "assert(store.getState()=== 5, 'redux store的state的值为5');"
}
],
"solutions": [
- "const reducer = (state = 5) => {\n return state;\n}\n\n// Redux methods are available from a Redux object\n// For example: Redux.createStore()\n// Define the store here:\n\nconst store = Redux.createStore(reducer);"
+ "const reducer = (state = 5) => {\n return state;\n}\n\n// Redux方法可以从Redux对象获得\n// 例如: Redux.createStore()\n// 在这里定义一个store:\n\nconst store = Redux.createStore(reducer);"
],
"challengeType": 6,
"isRequired": false,
@@ -64,7 +64,7 @@
},
{
"id": "5a24c314108439a4d403614c",
- "title": "Get State from the Redux Store",
+ "title": "从Redux store中获取state",
"releasedOn": "December 25, 2017",
"description": [
"The Redux store object provides several methods that allow you to interact with it. For example, you can retrieve the current state
held in the Redux store object with the getState()
method.",
@@ -1135,4 +1135,4 @@
"redux": true
}
]
-}
\ No newline at end of file
+}