Redux - gibt es eine Möglichkeit, access-Speicher Baum in reducer?

In meinem Fall, ich habe einen Shop wie:

{
  aa: {...},
  bb: cc  //the result of computing with aa
}

Ich aktualisieren aa und bb zur gleichen Zeit, aber bb brauchen, um die Letzte Berechnung der aa.

Hier ist ein code(React.js):

onClick(e) {
  const { dispatch, aa, bb } = this.props;

  dispatch(updateAa());
  dispatch(updateBb(aa)); //can not get the latest computation of aa, it is the last computation..
}

So, ist das bedeuten, dass ich brauche, um aa im bb's reducer?

Und Wie kann ich es tun?

Hoffen hilft!, Danke!

InformationsquelleAutor user2331095 | 2015-12-22
Schreibe einen Kommentar