Created
January 23, 2017 11:51
-
-
Save afdalwahyu/ff1572ef4fca3ed5a22b99afad82bd17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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