【发布时间】:2018-09-29 19:06:43
【问题描述】:
我在这里使用 Redux 和 React.js 我的 handleSubmit 方法:
handleSubmit = async (e) => {
e.preventDefault();
await this.props.createCoupon({
value: this.state.value,
expiresDate: new Date(this.state.expiresDate)
});
this.props.fetchCoupons();
}
从逻辑上讲,fetchCoupons 函数将在 createCoupon 完成后运行,这可行,但我在 CREATE_COUPON_SUCCESS 之前和之后进入我的控制台 FETCH_COUPONS_REQUEST,这是怎么回事?
【问题讨论】:
标签: javascript reactjs asynchronous redux