react-native-infinite-scroll-view
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -41,3 +41,3 @@ 'use strict'; | ||
this._onLoadMoreAsync = this._onLoadMoreAsync.bind(this); | ||
this._loadMoreAsync = this._loadMoreAsync.bind(this); | ||
} | ||
@@ -59,7 +59,7 @@ | ||
this.props.renderLoadingErrorIndicator( | ||
{ onRetryLoadMore: this._onLoadMoreAsync } | ||
{ onRetryLoadMore: this._loadMoreAsync } | ||
), | ||
{ key: 'loading-error-indicator' }, | ||
); | ||
} else if (this.props.canLoadMore) { | ||
} else if (this.state.isLoading) { | ||
statusIndicator = React.cloneElement( | ||
@@ -90,9 +90,4 @@ this.props.renderLoadingIndicator(), | ||
if (this.state.isLoading || !this.props.canLoadMore || | ||
this.state.isDisplayingError) { | ||
return; | ||
} | ||
if (this._distanceFromEnd(event) < this.props.distanceToLoadMore) { | ||
this._onLoadMoreAsync().catch(error => { | ||
if (this._shouldLoadMore(event)) { | ||
this._loadMoreAsync().catch(error => { | ||
console.error('Unexpected error while loading more content:', error); | ||
@@ -103,5 +98,12 @@ }); | ||
async _onLoadMoreAsync() { | ||
_shouldLoadMore(event) { | ||
return !this.state.isLoading && | ||
!this.props.canLoadMore && | ||
!this.state.isDisplayingError && | ||
this._distanceFromEnd(event) < this.props.distanceToLoadMore; | ||
} | ||
async _loadMoreAsync() { | ||
if (this.state.isLoading && __DEV__) { | ||
throw new Error('_onLoadMoreAsync called while isLoading is true'); | ||
throw new Error('_loadMoreAsync called while isLoading is true'); | ||
} | ||
@@ -108,0 +110,0 @@ |
{ | ||
"name": "react-native-infinite-scroll-view", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "An infinitely scrolling view that notifies you as the scroll offset approaches the bottom", | ||
@@ -5,0 +5,0 @@ "main": "InfiniteScrollView.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9017
151