在Redux中从Promise获取数据

时间:2020-08-20 10:36:38

标签: react-redux

当Reducer更新状态并且我从存储中获取状态时,它返回一个Promise。值中的内部承诺中有我的数据如何在承诺中访问此值。 enter image description here

enter image description here

1 个答案:

答案 0 :(得分:1)

要在Redux中使用异步操作,您将要使用中间件,主要是redux-thunkredux-saga。参见Why do we need middleware for async flow in Redux?

作为Redux的初学者,您可能应该从official documentation on the topic开始。