Zum Beispiel habe ich 2 Komponenten. In 1. mache ich Async-Anruf auf dem Server und nach dem Versand Aktion, um Antwort in Redux-Shop zu setzen. In der zweiten Komponente möchte ich auf die Antwort warten und nachher etwas speichern.Warten auf Daten in Redox
erste Komponente sieht aus wie
const response = await api.call(); // async call on server
dispatch(putToTheStore(response)); // put data to the store
zweite Komponente sieht aus wie
await props.response; // here i want to wait data come to store
// and after it actually come to the store, do some work
Ist es möglich?
componentWillReceiveProps - vergaß dies –