Skip to content

Comments

Provide item index in onFirstVisibleItemChange callback#7

Open
burrows wants to merge 1 commit intocentro:masterfrom
burrows:first-visible-item-index
Open

Provide item index in onFirstVisibleItemChange callback#7
burrows wants to merge 1 commit intocentro:masterfrom
burrows:first-visible-item-index

Conversation

@burrows
Copy link
Contributor

@burrows burrows commented Nov 1, 2019

I ran into a situation where I needed the index of the first visible item instead of the item itself. This change provides the index in the callback so that I don't need to perform the O(n) indexOf lookup. It adds it as the second param to the callback so it is backwards compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant