Skip to content

Instantly share code, notes, and snippets.

@afdalwahyu
Created January 23, 2017 11:51
Show Gist options
  • Save afdalwahyu/ff1572ef4fca3ed5a22b99afad82bd17 to your computer and use it in GitHub Desktop.
Save afdalwahyu/ff1572ef4fca3ed5a22b99afad82bd17 to your computer and use it in GitHub Desktop.
async _loadMore() {
if (this.state.buffering === false) {
this.setState({ buffering: true });
this.props.news.page += 1;
await this.props.news.fetchFeedPage(this.props.news.page);
this.setState({
dataSource: this.state.dataSource.cloneWithRows(this.props.news.feed.toJS()),
buffering: false,
});
}
}
render() {
<ListView
refreshControl={refreshControl}
enableEmptySections
initialListSize={2}
dataSource={this.state.dataSource}
renderRow={rowData => this.renderRow(rowData)}
onEndReached={() => this._loadMore()}
/>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment