MCPcopy
hub / github.com/react-guide/redux-tutorial-cn / asyncSayActionCreator_1

Function asyncSayActionCreator_1

09_middleware.js:112–122  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

110// 现在 store 的 middleware 已经准备好了,再来尝试分发我们的异步 action:
111
112var asyncSayActionCreator_1 = function (message) {
113 return function (dispatch) {
114 setTimeout(function () {
115 console.log(new Date(), 'Dispatch action now:')
116 dispatch({
117 type: 'SAY',
118 message
119 })
120 }, 2000)
121 }
122}
123
124console.log("\n", new Date(), 'Running our async action creator:', "\n")
125

Callers 1

09_middleware.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected