rememberQuery

fun <T> rememberQuery(key: QueryKey<T>, config: QueryConfig = QueryConfig.Default, client: QueryClient = LocalQueryClient.current): QueryObject<T>

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

Return

A QueryObject each the query state changed.

Parameters

T

Type of data to retrieve.

key

The QueryKey for managing query.

config

The configuration for the query. By default, it uses the QueryConfig.Default.

client

The QueryClient to resolve key. By default, it uses the LocalQueryClient.


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.

Return

A QueryObject with selected data each the query state changed.

Parameters

T

Type of data to retrieve.

U

Type of selected data.

key

The QueryKey for managing query.

select

A function to select data from T.

config

The configuration for the query. By default, it uses the QueryConfig.Default.

client

The QueryClient to resolve key. By default, it uses the LocalQueryClient.