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 - 忘了這個 –