small improvement of InfinityPagedComponent and add opportunity to set publishing type

This commit is contained in:
2025-06-18 14:31:01 +06:00
parent 4890b5833e
commit 36a2d7ec8e
2 changed files with 19 additions and 3 deletions

View File

@@ -82,9 +82,25 @@ fun <T> rememberInfinityPagedComponentContext(
size: Int,
page: Int = 0,
scope: CoroutineScope = rememberCoroutineScope(),
doReloadInInit: Boolean = true,
loader: suspend InfinityPagedComponentContext<T>.(Pagination) -> PaginationResult<T>
) = remember {
InfinityPagedComponentContext(page = page, size = size, scope = scope, loader = loader)
): InfinityPagedComponentContext<T> {
val context = remember {
InfinityPagedComponentContext(
page = page,
size = size,
scope = scope,
loader = loader
)
}
LaunchedEffect(context) {
if (doReloadInInit) {
context.reload()
}
}
return context
}
/**