Skip to content

Commit 24dede1

Browse files
committed
润饰、更正[11_src/src/action-creators.js]
统一替换[Tutorial]翻译为[章节]
1 parent 17004d1 commit 24dede1

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

11_src/src/action-creators.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
// 教程 12 - Provider-and-connect.js
1+
// 章节 12 - Provider-and-connect.js
22

33
// 我们使用 Bluebird(https://github.com/petkaantonov/bluebird) 作为 promise 库,但其实你可以用任何你喜欢的。
44
import Promise from 'bluebird'
55

6-
// 我们的 action 创建函数在一段延迟后获取当前时间,用于演示使用 promise 中间件
6+
// 我们的 action 创建函数在一段延迟后获取当前时间,用于演示 promise 中间件的用法
77

8-
// promise 中间件工作时会等待2种情况:
8+
// promise 中间件接收2种情况的 action:
99
// 1) 一个如下格式的 action:
1010
// {
1111
// types: [REQUEST, SUCCESS, FAILURE], // action 的 types 需要按该顺序给出
1212
// promise: function() {
1313
// // 返回一个 promise
1414
// }
1515
// }
16-
// 2) 其他任何可以传递给下一个中间件,或者 Redux (事实上,在这个 promise 中间件的实现中,"其他任何"传递到下一个中间件或Redux时,必须不包含 promise 属性)
16+
// 2) 其他任何可以传递给下一个中间件或 Redux 的 action, (准确的说,在这个 promise 中间件的实现中,这里的"其他任何 action" 传递到下一个中间件或 Redux 时,必须不包含 promise 属性)
1717

18-
// 当该 promise 中间件接收到这个 action,它会创建2个 action:
19-
// 一个 action 给 action 创建函数的 REQUEST,后一个 action 给 action 创建函数的 SUCCESS 或 FAILURE
18+
// 当该 promise 中间件接收到 action 之后,它会生成2个 action:
19+
// 一个 action 用于 action 创建函数的 REQUEST 情况,
20+
// 后一个 action 用于 action 创建函数的 SUCCESS 或 FAILURE 情况
2021

2122
// 再者,这个 promise 中间件的代码并不复杂,值得去看一看 (./promise-middleware.js)
2223

2324
// 下面的 action 使用 "delay" 作为一个参数传递,用来延迟该 action 创建函数。
24-
// 尝试改变延迟的值,验证它是否正确影响了我们UI
25+
// 尝试改变延迟的值,验证它是否正确影响了我们 UI
2526
export function getTime(delay) {
2627
return {
2728
types: ['GET_TIME_REQUEST', 'GET_TIME_SUCCESS', 'GET_TIME_FAILURE'],

11_src/src/application.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 教程 12 - Provider-and-connect.js
1+
// 章节 12 - Provider-and-connect.js
22

33
// 现在是时候见识 redux-react(https://github.com/rackt/react-redux)
44
// 如何在 Provider 组件中为我们做初次绑定了。

11_src/src/create-store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 教程 12 - Provider-and-connect.js
1+
// 章节 12 - Provider-and-connect.js
22

33
// 这里没有很多要说的, 现在你已经看到过这些很多次, 而且应该对它们很熟悉了...
44

11_src/src/home.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 教程 12 - Provider-and-connect.js
1+
// 章节 12 - Provider-and-connect.js
22

33
// 我们的教程快结束了,离对 Redux 有一个好的认识只差一步:
44
// 如何从 store 中的 state 读取,和以及如何派发 action?

11_src/src/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 教程 12 - Provider-and-connect.js
1+
// 章节 12 - Provider-and-connect.js
22

33
// 这个文件是我们 JS 包的入口。 在这里将创建我们的 Redux store,实例化我们的 React 应用根组件然后将它附加到DOM中。
44

11_src/src/reducers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 教程 12 - Provider-and-connect.js
1+
// 章节 12 - Provider-and-connect.js
22

33
// 这个文件包含我们应用仅有的一个 reducer。 它的表现对于你来说没什么新鲜的,除了将一个 action(GET_TIME) 的3个方面,写成3个专用的 action...
44
// 这样做允许我们做很漂亮的实时UI更新,就像这样:

11_src/src/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 教程 12 - Provider-and-connect.js
1+
// 章节 12 - Provider-and-connect.js
22

33
// 终于到这里了! 准备好在 React 应用中使用 Redux 了吗?
44

0 commit comments

Comments
 (0)