【发布时间】:2017-05-29 14:38:08
【问题描述】:
我是 React js 的新手,我对我的端点有疑问。 可以在 .then() 函数中调用另一个端点吗? 这是我的代码:
this.props.getReviwerSurvey(surveyId, authToken.id)
.then(
() => {
const {
reviewerSurvey } = this.state;
this.props.getAccount(reviewerSurvey && reviewerSurvey.relationships ?
reviewerSurvey.relationships.participant.id : null);
},
);
this.props.getReviewerSurvey 是我的第一个端点,我的第二个端点 this.props.getAccount() 好像不是标准的。如何在不调用回调中的 this.props.getAccount 的情况下获取 reviewerSurvey.relationships.participant.id 的值?如果有其他方法。想法受到高度赞赏。
【问题讨论】:
标签: reactjs ecmascript-6 react-redux axios