QueryCache class

Cache for storing and managing queries

Constructors

QueryCache()

Properties

events Stream<QueryCacheEvent>
Stream of cache events
no setter
hashCode int
The hash code for this object.
no setterinherited
length int
Number of queries in the cache
no setter
onDataSuccess ↔ void Function(QueryKey key, Object? data, DateTime? dataUpdatedAt)?
Callback for persisting query data on success
getter/setter pair
queries Iterable<Query>
Get all queries
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build<TData, TError>({required QueryOptions<TData, TError> options, QueryState<TData, TError>? state}) Query<TData, TError>
Build a query from options
clear() → void
Clear the cache
dispose() → void
Dispose the cache
findAll({QueryKey? queryKey, bool? stale, bool? fetching, bool predicate(Query query)?}) List<Query>
Find queries matching a filter
get<TData, TError>(QueryKey queryKey) Query<TData, TError>?
Get a typed query by key
getAll() List<Query>
Get all queries in the cache
getByHash(String queryHash) Query?
Get a query by hash
getQueryData<TData>(QueryKey queryKey) → TData?
Get query data by key
getUntyped(QueryKey queryKey) Query?
Get a query by key (untyped)
hydrateQuery({required QueryKey queryKey, required String queryHash, required dynamic serializedData, DateTime? dataUpdatedAt}) → void
Hydrate a query from persisted storage. Creates a query with the serialized data, which will be deserialized when a component subscribes with the appropriate serializer.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyUpdate(Query query) → void
Notify observers of a query update
remove(Query query) → void
Remove a query from the cache
setQueryData<TData>(QueryKey queryKey, TData data, {DateTime? updatedAt}) → TData?
Set query data by key
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited