buildInfiniteQueryKey

fun <T, S> buildInfiniteQueryKey(id: InfiniteQueryId<T, S>, fetch: suspend QueryReceiver.(param: S) -> T, initialParam: () -> S, loadMoreParam: (QueryChunks<T, S>) -> S?): InfiniteQueryKey<T, S>

Function for building implementations of InfiniteQueryKey using Kotlin Delegation.

Note: By implementing through delegation, you can reduce the impact of future changes to InfiniteQueryKey interface extensions.

Usage:

class GetPostsKey(userId: Int? = null) : InfiniteQueryKey<Posts, PageParam> by buildInfiniteQueryKey(
id = Id(userId),
fetch = { param -> ... }
initialParam = { PageParam(limit = 20) },
loadMoreParam = { chunks -> ... }
)