LazyLoad

inline fun <T : Any> LazyLoad(state: LazyGridState, loadMore: LazyLoadMore<T>, loadMoreParam: T?, threshold: LazyGridThreshold = LazyGridThreshold(), debounceTimeout: Duration = 200.milliseconds)

A composable function that enables infinite scrolling for a LazyVerticalGrid or LazyHorizontalGrid.

This function automatically triggers the loadMore callback when the user scrolls close to the end of the grid, based on the specified threshold.

NOTE: For each unique loadMoreParam value, the loadMore callback will be invoked at most once. When loadMoreParam changes, the load detection will start over with the new parameter.

Parameters

T

The type of parameter to pass to the loadMore callback

state

The LazyGridState of the lazy grid to monitor

loadMore

Callback function that will be invoked to load additional data

loadMoreParam

Parameter to pass to the loadMore callback, if null no loading will occur

threshold

Configuration that determines when to trigger loading more items

debounceTimeout

Duration to debounce scroll events to prevent multiple rapid load requests


inline fun <T : Any> LazyLoad(state: LazyListState, loadMore: LazyLoadMore<T>, loadMoreParam: T?, threshold: LazyListThreshold = LazyListThreshold(), debounceTimeout: Duration = 200.milliseconds)

A composable function that enables infinite scrolling for a LazyColumn or LazyRow.

This function automatically triggers the loadMore callback when the user scrolls close to the end of the list, based on the specified threshold.

NOTE: For each unique loadMoreParam value, the loadMore callback will be invoked at most once. When loadMoreParam changes, the load detection will start over with the new parameter.

Parameters

T

The type of parameter to pass to the loadMore callback

state

The LazyListState of the lazy list to monitor

loadMore

Callback function that will be invoked to load additional data

loadMoreParam

Parameter to pass to the loadMore callback, if null no loading will occur

threshold

Configuration that determines when to trigger loading more items

debounceTimeout

Duration to debounce scroll events to prevent multiple rapid load requests


inline fun <T : Any, S> LazyLoad(state: S, loadMore: LazyLoadMore<T>, loadMoreParam: T?, strategy: LazyLoadStrategy<S>, debounceTimeout: Duration = 200.milliseconds)

Core composable that implements infinite scrolling logic for any scrollable state.

This function sets up a LaunchedEffect that monitors the scroll state and triggers the loadMore callback when the scrolling position meets the conditions defined by the strategy.

NOTE: For each unique loadMoreParam value, the loadMore callback will be invoked at most once. When loadMoreParam changes, the load detection will start over with the new parameter.

Parameters

T

The type of parameter to pass to the loadMore callback

S

The type of scrollable state being monitored

state

The scrollable state to monitor (e.g., LazyListState, LazyGridState)

loadMore

Callback function that will be invoked to load additional data

loadMoreParam

Parameter to pass to the loadMore callback, if null no loading will occur

strategy

Strategy that determines when additional data should be loaded

debounceTimeout

Duration to debounce scroll events to prevent multiple rapid load requests