Async state management for Leptos, providing simplified data fetching, integrated reactivity, SSR support, and smart cache management.
Full Changelog: https://github.com/gaucho-labs/leptos-query/compare/v0.5.2...v0.5.3
Devtools version updated to v0.1.1
which fixed the following:
Full Changelog: https://github.com/nicoburniske/leptos_query/compare/v0.5.1...v0.5.2
with_query_supression
for running a closure with query suppressionFull Changelog: https://github.com/nicoburniske/leptos_query/compare/v0.5.0...v0.5.1
create_query
to group common query types. Removes the necessity of having to supply <K,V> types to query client methods (very error prone).leptos_query::cache_observer::CacheObserver
leptos_query::DefaultOptions
QueryClient::clear()
leptos_query::query_persister::QueryPersister
leptos_query::query_persister::LocalStoragePersister
QueryClient::cancel_query
Renamed cache_time
to gc_time
(garbage collection time)
is_stale
field removed from QueryResult
fetch_query and prefetch_query are now async functions for one off mutations
IMPORTANT Query Key types may not correspond to multiple value types anymore. A Key
type may only be globally associated with a single Value
type.
QueryClient
, and have nothing happen.Full Changelog: https://github.com/nicoburniske/leptos_query/compare/v0.4.0...v0.5.0
Added support for Leptos 0.6
Full Changelog: https://github.com/nicoburniske/leptos_query/compare/v0.3.0...v0.4.0
Full Changelog: https://github.com/nicoburniske/leptos_query/compare/v0.2.3...v0.3.0
create_memo
that caused a BorrowError
when invalidating an active queryinvalidate_query_type
and invalidate_all
methodsQueryClient::set_query_data_now
std::borrow::Borrow
Full Changelog: https://github.com/nicoburniske/leptos_query/compare/v0.2.0...v0.2.3
New version based on introduction of QueryState<V>
enum
A Query will only be evicted from cache once it are no longer being used, and the specified cache_time
has elapsed since the last update. If a query gets marked for eviction, then receives an update as it's being used, it will not get evicted from cache and the timeout will restart.
QueryState<V>
enumQueryResult
now contains a signal for the current QueryState
. This required a lot of changes internally, but only a few for users.
Stale is intentionally not a state, and is instead a derived signal inside of QueryResult
. This distinction allows for a query to be stale, while also having a descriptive state.
Here's what it looks like:
pub enum QueryState<V> {
/// The initial state of a Query upon its creation.
Created,
/// Query is fetching for the first time.
Loading,
/// A Query is in the process of fetching, not being its first fetch.
Fetching(QueryData<V>),
/// The state indicating that a query has successfully completed a fetch operation.
Loaded(QueryData<V>),
/// The state indicating that a query has completed a fetch, but the fetched data is marked as invalid.
Invalid(QueryData<V>),
}
QueryResult<V> now becomes QueryResult<V, impl RefetchFn>
RefetchFn
is equivalent toFn() + Clone
QueryResult::refetch
is now Fn() + Clone
instead of SignalSetter<()>
QueryResult
now contains a QueryState<V>
updated_at
QueryClient::get_query_data
due to inconsistent behavior.Full Changelog: https://github.com/nicoburniske/leptos_query/commits/v0.2.0