pageSelections

Create a InitialValueFlow of page selected events on the ViewPager instance where the value emitted is the position index of the new selected page.

Note: Created flow keeps a strong reference to the ViewPager instance until the coroutine that launched the flow collector is cancelled.

Example of usage:

viewPager.pageSelections()
.onEach { position ->
// handle position
}
.launchIn(uiScope)