0
반응 나는이 두 가지 작업을 전달합니다 다음 핸들러 ... 내가 대신 같이이 싶습니다 무엇는 돌아 오는
_onPress =() => {
let { request,userId} = this.props;
this.props.dispatch(acceptRequest(request.id,userId))
this.props.dispatch(navigatePop());
}
은 다음과 ...
입니다_onPress =() => {
let { request,userId} = this.props;
this.props.dispatch(acceptRequest(request.id,userId))
.then(this.props.dispatch(navigatePop()))
}
내 ActionCreator은 다음과 같습니다
...
export function acceptRequest(requestId,fulfilledBy){
return dispatch => {
fulfillments.create(requestId,fulfilledBy)
.then(response => response.json())
.then(fulfillment => {
dispatch(_acceptRequestSuccess(fulfillment))
})
.catch(err => {
console.log(err);
dispatch(_acceptRequestError(error))
})
}
}
나는 그들이 많은 미들웨어 (들)을 가지고 있음을 알고 그 사람들이 제안하지만, 나는 을 처리하지 않으면이 시나리오에 맞는 것을 보지 못합니다. . 내 특정 경우
, 나는 첫 번째 성공 경우 번째 차이점 조치를 파견하고 싶은,하지만 덜 재사용 때문에 작업 창조자에서이 작업을 수행 할 수 없습니다.