Skip to content

Instantly share code, notes, and snippets.

@sueLan
Created March 5, 2020 13:33
Show Gist options
  • Save sueLan/c6b01e11eedd998cfc48c9a44720fc52 to your computer and use it in GitHub Desktop.
Save sueLan/c6b01e11eedd998cfc48c9a44720fc52 to your computer and use it in GitHub Desktop.
if (this.props.viewabilityConfigCallbackPairs) {
this._viewabilityTuples = this.props.viewabilityConfigCallbackPairs.map(
pair => ({
viewabilityHelper: new ViewabilityHelper(pair.viewabilityConfig),
onViewableItemsChanged: pair.onViewableItemsChanged,
}),
);
} else if (this.props.onViewableItemsChanged) {
this._viewabilityTuples.push({
viewabilityHelper: new ViewabilityHelper(this.props.viewabilityConfig),
onViewableItemsChanged: this.props.onViewableItemsChanged,
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment