How to wait for data in redux

Viewed 2783

For example I have 2 components. In 1st I do async call on server and after dispatch action to put response in to redux store. In 2nd component I want to wait for the response come to store and after do some work.

1st component looks like

const response = await api.call(); // async call on server
dispatch(putToTheStore(response)); // put data to the store

2nd component looks like

await props.response; // here i want to wait data come to store

// and after it actually come to the store, do some work

Is it possible ?

1 Answers
Related