LazyLoadCustomEffect

inline fun <T : Any, S : ScrollableState> LazyLoadCustomEffect(state: S, noinline loadMore: suspend (T) -> Unit, loadMoreParam: T?, totalItemsCount: Int, threshold: LazyLoadThreshold = LazyLoadThreshold.Lazily, direction: LazyLoadDirection = LazyLoadDirection.Forward, crossinline computeVisibleItemIndex: (state: S) -> Int)

Provides a LaunchedEffect to perform additional loading for soil.query.compose.InfiniteQueryObject.

The percentage is calculated from the values of computeVisibleItemIndex and totalItemsCount. It only triggers when the threshold is reached.

Parameters

state

The scroll state inherited from ScrollableState.

loadMore

Specifies the function to call for loading more items, typically soil.query.compose.InfiniteQueryObject.loadMore.

loadMoreParam

The parameter passed to soil.query.compose.InfiniteQueryObject.loadMore. If null, the effect is not triggered.

totalItemsCount

The total number of items related to state.

threshold

The threshold scroll position at which to trigger additional loading.

direction

The direction for loading more items.

computeVisibleItemIndex

A function that calculates the index of the visible item used as the reference for additional loading.