SwrClient

An all-in-one SwrClient integrating MutationClient and QueryClient for library users.

Swr stands for "stall-while-revalidate".

Inheritors

Properties

Link copied to clipboard

The default mutation options.

Link copied to clipboard

The default query options.

Link copied to clipboard
abstract val errorRelay: Flow<ErrorRecord>

Provides a unified feedback mechanism for all Query/Mutation errors that occur within the client.

Functions

Link copied to clipboard
abstract fun gc(level: MemoryPressureLevel = MemoryPressureLevel.Low)

Releases data in memory based on the specified level.

Link copied to clipboard
abstract fun <T, S> getInfiniteQuery(key: InfiniteQueryKey<T, S>, marker: Marker = Marker.None): InfiniteQueryRef<T, S>

Gets the InfiniteQueryRef by the specified InfiniteQueryKey.

Link copied to clipboard
abstract fun <T, S> getMutation(key: MutationKey<T, S>, marker: Marker = Marker.None): MutationRef<T, S>

Gets the MutationRef by the specified MutationKey.

Link copied to clipboard
abstract fun <T> getQuery(key: QueryKey<T>, marker: Marker = Marker.None): QueryRef<T>

Gets the QueryRef by the specified QueryKey.

Link copied to clipboard
abstract fun onMount(id: String)

Executes initialization procedures based on events.

Link copied to clipboard
abstract fun onUnmount(id: String)

Executes cleanup procedures based on events.

Link copied to clipboard
abstract fun perform(sideEffects: QueryEffect): Job

Executes side effects for queries.

Link copied to clipboard
abstract fun <T, S> prefetchInfiniteQuery(key: InfiniteQueryKey<T, S>, marker: Marker = Marker.None): Job

Prefetches the infinite query by the specified InfiniteQueryKey.

Link copied to clipboard
abstract fun <T> prefetchQuery(key: QueryKey<T>, marker: Marker = Marker.None): Job

Prefetches the query by the specified QueryKey.