다른 작업 후 돌아 오는 디스패치 작용 반작용 top = 10, skip = 0
의 초기 상태입니다. 구성 요소 :내가 REST의 API로부터 데이터를 페치 <strong>비동기</strong> 작용을 가지고
class List extends Component {
componentDidMount() {
this.list();
}
nextPage() {
let top = this.props.list.top;
let skip = this.props.list.skip;
// After this
this.props.onSetSkip(skip + top);
// Here skip has previous value of 0.
this.list();
// Here skip has new value of 10.
}
list() {
this.props.List(this.props.list.top, this.props.list.skip);
}
render() {
return (
<div>
<table> ... </table>
<button onClick={this.nextPage.bind(this)}>Next</button>
</div>
);
}
}
, 비동기 동작을 사용 skip
의 값은 변경되지. 이 (가)에 동기화 된 후 조치를 전달하는 방법은 무엇입니까?
도움 주셔서 감사합니다. 몇 가지 예제 코드를 제공 할 수 있습니까? (나는 반응의 neebie 다). –
@DenisBednov 썽크 가이드를 따라 간다면 썽크가 도움이 될 것입니다. 가이드에 링크 된 것과 같이 감속기를 분할하면 내가 무슨 말을하고 있는지 알게 될 것입니다. –