Guest User

Untitled

a guest
Feb 23rd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. handleOriginCurrencyChange(event) {
  2. var newCurrency = event.target.value;
  3. this.props.dispatch(actions.changeOriginCurrency(newCurrency));
  4.  
  5. // will the dispatch above affects `this.props`?
  6. // cause I think the dispatch will trigger the update
  7. var payload = {
  8. originAmount: this.props.originAmount,
  9. originCurrency: newCurrency,
  10. destCurrency: this.props.destinationCurrency,
  11. calcOriginAmount: false,
  12. };
  13.  
  14.  
  15. // this one is a async ajax dispatch,
  16. // will the function stop here
  17. // when resolve then continue the func
  18. // finally do the last diapatch?
  19. this.props.dispatch(actions.fetchConversionRate(payload));
  20.  
  21. var feePayload = {
  22. originAmount: this.props.originAmount,
  23. originCurrency: newCurrency,
  24. destCurrency: this.props.destinationCurrency,
  25. };
  26.  
  27. this.props.dispatch(actions.fetchFees(feePayload));
  28. }
Add Comment
Please, Sign In to add comment