Redux发起API请求

Redux的API请求应该放在什么位置,redux的文档Advanced一节中进行了比较详细的描述,一个很直观的做法是将API请求直接放在action creator中(用redux-thunk中间件来执行异步操作)。比如 export function loadPosts(userId) { // Interpreted by the thunk middleware: return function (dispatch, getState) { let { posts } = getState() if (posts[userId]) { // There »