4
例如,我有2个组件。在第一次我做服务器上的异步调用,并在派遣行动后,将响应放入Redux商店。在第二部分,我想等待响应来存储和做一些工作后。如何等待数据减少
第一个部件看起来像
const response = await api.call(); // async call on server
dispatch(putToTheStore(response)); // put data to the store
第二部分看起来像
await props.response; // here i want to wait data come to store
// and after it actually come to the store, do some work
这可能吗?
componentWillReceiveProps - 忘了这个 –