small improvement of InfinityPagedComponent and add opportunity to set publishing type

This commit is contained in:
InsanusMokrassar committed 2025-06-18 14:31:01 +06:00
1 parent 4890b5833e
commit 36a2d7ec8e
2 files changed
+19 -3

No files matched your search

@@ -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
}
/**