I need to listen to the scroll values of a Column and post the value to the view model. This works with a LaunchedEffect
, but it causes recomposition on each new scroll value. The code looks something like this:
val scrollState = rememberScrollState(0)
LaunchedEffect(scrollState.value) {
Log.d(TAG, "Scrolled to ${scrollState.value}")
}
Column(modifier = Modifier.scrollable(scrollState)) {
...
}
How can I react to scrolling without recomposition happening?