Package-level declarations

Types

Link copied to clipboard
sealed interface CachingStrategy

A mechanism to finely adjust the behavior of the query results on a component basis in Composable functions.

Link copied to clipboard

Configuration for the infinite query.

Link copied to clipboard
data class InfiniteQueryLoadingErrorObject<T, S>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable, val errorUpdatedAt: Long, val staleAt: Long, val fetchStatus: QueryFetchStatus, val isInvalidated: Boolean, val refresh: suspend () -> Unit, val loadMore: suspend (param: S) -> Unit, val loadMoreParam: S?) : InfiniteQueryObject<T, S>

A InfiniteQueryLoadingErrorObject represents the initial loading error state of the InfiniteQueryObject.

Link copied to clipboard
data class InfiniteQueryLoadingObject<T, S>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable?, val errorUpdatedAt: Long, val staleAt: Long, val fetchStatus: QueryFetchStatus, val isInvalidated: Boolean, val refresh: suspend () -> Unit, val loadMore: suspend (param: S) -> Unit, val loadMoreParam: S?) : InfiniteQueryObject<T, S>

A InfiniteQueryLoadingObject represents the initial loading state of the InfiniteQueryObject.

Link copied to clipboard
sealed interface InfiniteQueryObject<out T, S> : QueryModel<T>

A InfiniteQueryObject represents QueryModels interface for infinite fetching data using a retrieval method known as "infinite scroll."

Link copied to clipboard

A mapper that converts QueryState to InfiniteQueryObject.

Link copied to clipboard
data class InfiniteQueryRefreshErrorObject<T, S>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable, val errorUpdatedAt: Long, val staleAt: Long, val fetchStatus: QueryFetchStatus, val isInvalidated: Boolean, val refresh: suspend () -> Unit, val loadMore: suspend (param: S) -> Unit, val loadMoreParam: S?) : InfiniteQueryObject<T, S>

A InfiniteQueryRefreshErrorObject represents the refresh error state of the InfiniteQueryObject.

Link copied to clipboard

A mechanism to finely adjust the behavior of the infinite-query on a component basis in Composable functions.

Link copied to clipboard
data class InfiniteQuerySuccessObject<T, S>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable?, val errorUpdatedAt: Long, val staleAt: Long, val fetchStatus: QueryFetchStatus, val isInvalidated: Boolean, val refresh: suspend () -> Unit, val loadMore: suspend (param: S) -> Unit, val loadMoreParam: S?) : InfiniteQueryObject<T, S>

A InfiniteQuerySuccessObject represents the successful state of the InfiniteQueryObject.

Link copied to clipboard

Configuration for the mutation.

Link copied to clipboard
data class MutationErrorObject<T, S>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable, val errorUpdatedAt: Long, val mutatedCount: Int, val mutate: suspend (S) -> T, val mutateAsync: suspend (S) -> Unit, val reset: suspend () -> Unit) : MutationObject<T, S>

A MutationErrorObject represents the error state of the MutationObject.

Link copied to clipboard
data class MutationIdleObject<T, S>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable?, val errorUpdatedAt: Long, val mutatedCount: Int, val mutate: suspend (S) -> T, val mutateAsync: suspend (S) -> Unit, val reset: suspend () -> Unit) : MutationObject<T, S>

A MutationIdleObject represents the initial idle state of the MutationObject.

Link copied to clipboard
data class MutationLoadingObject<T, S>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable?, val errorUpdatedAt: Long, val mutatedCount: Int, val mutate: suspend (S) -> T, val mutateAsync: suspend (S) -> Unit, val reset: suspend () -> Unit) : MutationObject<T, S>

A Mutation Loading Object represents the waiting execution result state of the Mutation Object.

Link copied to clipboard
sealed interface MutationObject<out T, S> : MutationModel<T>

A MutationObject represents MutationModels interface for mutating data.

Link copied to clipboard

A mapper that converts MutationState to MutationObject.

Link copied to clipboard

A mechanism to finely adjust the behavior of the mutation on a component basis in Composable functions.

Link copied to clipboard
data class MutationSuccessObject<T, S>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable?, val errorUpdatedAt: Long, val mutatedCount: Int, val mutate: suspend (S) -> T, val mutateAsync: suspend (S) -> Unit, val reset: suspend () -> Unit) : MutationObject<T, S>

A MutationSuccessObject represents the successful state of the MutationObject.

Link copied to clipboard
typealias QueriesErrorReset = () -> Unit
Link copied to clipboard

Configuration for the query.

Link copied to clipboard
data class QueryLoadingErrorObject<T>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable, val errorUpdatedAt: Long, val staleAt: Long, val fetchStatus: QueryFetchStatus, val isInvalidated: Boolean, val refresh: suspend () -> Unit) : QueryObject<T>

A QueryLoadingErrorObject represents the initial loading error state of the QueryObject.

Link copied to clipboard
data class QueryLoadingObject<T>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable?, val errorUpdatedAt: Long, val staleAt: Long, val fetchStatus: QueryFetchStatus, val isInvalidated: Boolean, val refresh: suspend () -> Unit) : QueryObject<T>

A QueryIdleObject represents the initial loading state of the QueryObject.

Link copied to clipboard
sealed interface QueryObject<out T> : QueryModel<T>

A QueryObject represents QueryModels interface for fetching data.

Link copied to clipboard

A mapper that converts QueryState to QueryObject.

Link copied to clipboard
data class QueryRefreshErrorObject<T>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable, val errorUpdatedAt: Long, val staleAt: Long, val fetchStatus: QueryFetchStatus, val isInvalidated: Boolean, val refresh: suspend () -> Unit) : QueryObject<T>

A QueryRefreshErrorObject represents the refresh error state of the QueryObject.

Link copied to clipboard

A mechanism to finely adjust the behavior of the query on a component basis in Composable functions.

Link copied to clipboard
data class QuerySuccessObject<T>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable?, val errorUpdatedAt: Long, val staleAt: Long, val fetchStatus: QueryFetchStatus, val isInvalidated: Boolean, val refresh: suspend () -> Unit) : QueryObject<T>

A QuerySuccessObject represents the successful state of the QueryObject.

Link copied to clipboard

Configuration for the subscription.

Link copied to clipboard
data class SubscriptionErrorObject<T>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable, val errorUpdatedAt: Long, val subscriberStatus: SubscriberStatus, val subscribe: suspend () -> Unit, val unsubscribe: () -> Unit, val reset: suspend () -> Unit) : SubscriptionObject<T>

A SubscriptionErrorObject represents the error state of the SubscriptionObject.

Link copied to clipboard
data class SubscriptionIdleObject<T>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable?, val errorUpdatedAt: Long, val subscribe: suspend () -> Unit, val unsubscribe: () -> Unit, val reset: suspend () -> Unit) : SubscriptionObject<T>

A SubscriptionIdleObject represents the initial idle state of the SubscriptionObject.

Link copied to clipboard
data class SubscriptionLoadingObject<T>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable?, val errorUpdatedAt: Long, val subscribe: suspend () -> Unit, val unsubscribe: () -> Unit, val reset: suspend () -> Unit) : SubscriptionObject<T>

A SubscriptionLoadingObject represents the initial loading state of the SubscriptionObject.

Link copied to clipboard
sealed interface SubscriptionObject<out T> : SubscriptionModel<T>

A SubscriptionObject represents SubscriptionModels interface for receiving data.

Link copied to clipboard
Link copied to clipboard

A mechanism to finely adjust the behavior of the subscription on a component basis in Composable functions.

Link copied to clipboard
data class SubscriptionSuccessObject<T>(val reply: Reply<T>, val replyUpdatedAt: Long, val error: Throwable?, val errorUpdatedAt: Long, val subscriberStatus: SubscriberStatus, val subscribe: suspend () -> Unit, val unsubscribe: () -> Unit, val reset: suspend () -> Unit) : SubscriptionObject<T>

A SubscriptionSuccessObject represents the successful state of the SubscriptionObject.

Properties

Link copied to clipboard

The default built-in strategy for Infinite Query built into the library.

The default built-in strategy for Mutation built into the library.

The default QueryObjectMapper.

The default built-in strategy for Query built into the library.

The default built-in strategy for Subscription built into the library.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun KeepAlive(key: InfiniteQueryKey<*, *>, client: QueryClient = LocalQueryClient.current)

Keep the infinite query alive.

fun KeepAlive(key: MutationKey<*, *>, client: MutationClient = LocalMutationClient.current)

Keep the mutation alive.

fun KeepAlive(key: QueryKey<*>, client: QueryClient = LocalQueryClient.current)

Keep the query alive.

Link copied to clipboard

Creates a MutationConfig with the provided initializer.

Link copied to clipboard

Creates a QueryConfig with the provided initializer.

Link copied to clipboard
fun <T, S> rememberInfiniteQuery(key: InfiniteQueryKey<T, S>, config: InfiniteQueryConfig = InfiniteQueryConfig.Default, client: QueryClient = LocalQueryClient.current): InfiniteQueryObject<QueryChunks<T, S>, S>
fun <T, S, U> rememberInfiniteQuery(key: InfiniteQueryKey<T, S>, select: (QueryChunks<T, S>) -> U, config: InfiniteQueryConfig = InfiniteQueryConfig.Default, client: QueryClient = LocalQueryClient.current): InfiniteQueryObject<U, S>

Remember a InfiniteQueryObject and subscribes to the query state of key.

Link copied to clipboard
fun <T, S> rememberMutation(key: MutationKey<T, S>, config: MutationConfig = MutationConfig.Default, client: MutationClient = LocalMutationClient.current): MutationObject<T, S>

Remember a MutationObject and subscribes to the mutation state of key.

Link copied to clipboard
fun rememberQueriesErrorReset(filter: ResumeQueriesFilter = remember { ResumeQueriesFilter(predicate = { it.isFailure }) }, client: SwrClient = LocalSwrClient.current): QueriesErrorReset

Remember a QueriesErrorReset to resume all queries with filter matched.

Link copied to clipboard
fun <T> rememberQuery(key: QueryKey<T>, config: QueryConfig = QueryConfig.Default, client: QueryClient = LocalQueryClient.current): QueryObject<T>
fun <T, U> rememberQuery(key: QueryKey<T>, select: (T) -> U, config: QueryConfig = QueryConfig.Default, client: QueryClient = LocalQueryClient.current): QueryObject<U>

Remember a QueryObject and subscribes to the query state of key.

Link copied to clipboard
fun <T> rememberSubscription(key: SubscriptionKey<T>, config: SubscriptionConfig = SubscriptionConfig.Default, client: SubscriptionClient = LocalSubscriptionClient.current): SubscriptionObject<T>
fun <T, U> rememberSubscription(key: SubscriptionKey<T>, select: (T) -> U, config: SubscriptionConfig = SubscriptionConfig.Default, client: SubscriptionClient = LocalSubscriptionClient.current): SubscriptionObject<U>

Remember a SubscriptionObject and subscribes to the subscription state of key.

Link copied to clipboard
Link copied to clipboard
fun SwrClientProvider(client: SwrClient, content: @Composable () -> Unit)

Provides a SwrClient to the content over LocalSwrClient

Provides a SwrClientPlus to the content over LocalSwrClient