Skip to content

Instantly share code, notes, and snippets.

@sueLan
Created March 5, 2020 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sueLan/8286d5eec0148ab1fad570c98ec0cc17 to your computer and use it in GitHub Desktop.
Save sueLan/8286d5eec0148ab1fad570c98ec0cc17 to your computer and use it in GitHub Desktop.
_updateViewableItems(data: any) {
const {getItemCount} = this.props;
this._viewabilityTuples.forEach(tuple => {
tuple.viewabilityHelper.onUpdate(
getItemCount(data),
// contentOffset of the list
this._scrollMetrics.offset,
// 🌟 viewportHeight
this._scrollMetrics.visibleLength,
this._getFrameMetrics,
this._createViewToken,
tuple.onViewableItemsChanged,
this.state,
);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment