buildQueryKey

fun <T> buildQueryKey(id: QueryId<T>, fetch: suspend QueryReceiver.() -> T): QueryKey<T>

Function for building implementations of QueryKey using Kotlin Delegation.

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

Usage:

class GetPostKey(private val postId: Int) : QueryKey<Post> by buildQueryKey(
id = Id(postId),
fetch = { ... }
)