Skip to content

Commit 1dc5331

Browse files
committed
修正术语[action creator]为[action 创建函数]
1 parent be35b9b commit 1dc5331

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

11_src/src/action-creators.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// 我们使用 Bluebird(https://github.com/petkaantonov/bluebird) 作为 promise 库,但其实你可以用任何你喜欢的。
44
import Promise from 'bluebird'
55

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

88
// promise 中间件工作时会等待2种情况:
99
// 1) 一个如下格式的 action:
@@ -16,11 +16,11 @@ import Promise from 'bluebird'
1616
// 2) 其他任何可以传递给下一个中间件,或者 Redux (事实上,在这个 promise 中间件的实现中,"其他任何"传递到下一个中间件或Redux时,必须不包含 promise 属性)
1717

1818
// 当该 promise 中间件接收到这个 action,它会创建2个 action:
19-
// 一个 action 给 action creator 的 REQUEST,后一个 action 给 action creator 的 SUCCESS 或 FAILURE
19+
// 一个 action 给 action 创建函数的 REQUEST,后一个 action 给 action 创建函数的 SUCCESS 或 FAILURE
2020

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

23-
// 下面的 action 使用 "delay" 作为一个参数传递,用来延迟该 action creator
23+
// 下面的 action 使用 "delay" 作为一个参数传递,用来延迟该 action 创建函数
2424
// 尝试改变延迟的值,验证它是否正确影响了我们UI。
2525
export function getTime(delay) {
2626
return {

11_src/src/create-store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// 这里没有很多要说的, 现在你已经看到过这些很多次, 而且应该对它们很熟悉了...
44

55
// 尽管这样,但还是有一点要注意: 我们这里不使用之前用过的 thunk middleware。
6-
// 替而代之的是 promise middleware,它允许我们处理异步的 action creator,
6+
// 替而代之的是 promise middleware,它允许我们处理异步的 action 创建函数,
77
// 然后漂亮的实时处理UI更新(也可以做一些乐观的更新)。
88
// 这个中间件在 https://github.com/rackt/redux/issues/99有讨论,
99
// 在 react-redux-universal-example: https://github.com/erikras/react-redux-universal-hot-example中有非常好的使用案例,

11_src/src/home.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151

5252
import React from 'react'
5353
import { connect } from 'react-redux'
54-
// 我们用 ES6 的 import 写法来获取所有的 action creator, 如同我们在 reducers 中那样。
55-
// 如果你还没看过我们的 action creator, 转到 ./action-creators.js 去看看。
54+
// 我们用 ES6 的 import 写法来获取所有的 action 创建函数, 如同我们在 reducers 中那样。
55+
// 如果你还没看过我们的 action 创建函数, 转到 ./action-creators.js 去看看。
5656
import * as actionCreators from './action-creators'
5757

5858
class Home extends React.Component {

0 commit comments

Comments
 (0)