KacheResource<T> class final

A disposable handle that observes and controls one KacheQuery.

Properties

hashCode int
The hash code for this object.
no setterinherited
isDisposed bool
Whether dispose has released this handle.
no setter
key KacheKey
no setter
query KacheQuery<T>
The immutable declaration currently used by this handle.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapshot KacheSnapshot<T>
The current shared snapshot, available synchronously.
no setter
stream Stream<KacheSnapshot<T>>
A broadcast stream that replays snapshot to every new listener.
no setter

Methods

cancel() bool
Cancels the shared in-flight fetch for this key.
dispose() → void
Idempotently releases this handle and closes its stream.
invalidate({bool refetch = true}) Future<KacheSnapshot<T>>
Marks current data stale and optionally starts a fresh fetch.
load() Future<KacheSnapshot<T>>
Loads cache data and applies this handle's load policy.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pausePolling() → void
refresh() Future<KacheSnapshot<T>>
Forces a fetch with this handle's fetcher, ignoring freshness.
refreshActive() Future<void>
remove() Future<KacheSnapshot<T>>
Removes current memory and persisted data without fetching.
resumePolling() → void
revalidateOnResume() Future<void>
setData(T data) Future<KacheSnapshot<T>>
Replaces current data immediately and persists it when configured.
toString() String
A string representation of this object.
inherited
updateData(T update(KacheSnapshot<T> snapshot)) Future<KacheSnapshot<T>>
Atomically computes and stores data from the latest shared snapshot.
updateQuery(KacheQuery<T> query) → void
Replaces this handle's same-key fetcher and policy without loading.

Operators

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