SwrPreviewClient

class SwrPreviewClient(query: QueryPreviewClient = QueryPreviewClient(emptyMap()), mutation: MutationPreviewClient = MutationPreviewClient(emptyMap()), subscription: SubscriptionPreviewClient = SubscriptionPreviewClient(emptyMap()), val errorRelay: Flow<ErrorRecord> = flow { }) : SwrClient, SwrClientPlus, QueryClient, MutationClient, SubscriptionClient

Provides the ability to preview specific queries and mutations for composable previews.

val client = SwrPreviewClient(..)
SwrClientProvider(client = client) {
// Composable previews
}

Constructors

Link copied to clipboard
constructor(query: QueryPreviewClient = QueryPreviewClient(emptyMap()), mutation: MutationPreviewClient = MutationPreviewClient(emptyMap()), subscription: SubscriptionPreviewClient = SubscriptionPreviewClient(emptyMap()), errorRelay: Flow<ErrorRecord> = flow { })

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val errorRelay: Flow<ErrorRecord>

Functions

Link copied to clipboard
open override fun gc(level: MemoryPressureLevel)
Link copied to clipboard
open override fun <T, S> getInfiniteQuery(key: InfiniteQueryKey<T, S>, marker: Marker): InfiniteQueryRef<T, S>
Link copied to clipboard
open override fun <T, S> getMutation(key: MutationKey<T, S>, marker: Marker): MutationRef<T, S>
Link copied to clipboard
open override fun <T> getQuery(key: QueryKey<T>, marker: Marker): QueryRef<T>
Link copied to clipboard
open override fun <T> getSubscription(key: SubscriptionKey<T>, marker: Marker): SubscriptionRef<T>
Link copied to clipboard
open override fun onMount(id: String)
Link copied to clipboard
open override fun onUnmount(id: String)
Link copied to clipboard
open override fun perform(sideEffects: QueryEffect): Job
Link copied to clipboard
open override fun <T, S> prefetchInfiniteQuery(key: InfiniteQueryKey<T, S>, marker: Marker): Job
Link copied to clipboard
open override fun <T> prefetchQuery(key: QueryKey<T>, marker: Marker): Job
Link copied to clipboard
open override fun purgeAll()