CachedSourceOfTruth<Key, T> class

A memory cache implementation of a SourceOfTruth, which stores the latest value and notify new ones.

Implemented types
Available Extensions

Constructors

CachedSourceOfTruth([Map<Key, T?>? cachedValues])
CachedSourceOfTruth constructor

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(Key key) Future<void>
Used by Stock to delete records in the source of truth for the given key.
override
deleteAll() Future<void>
Used by Stock to delete all records in the source of truth.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reader(Key key) Stream<T?>
Used by Stock to read records from the source of truth for the given key.
override
setCachedValue(Key key, T? value) → void
Used to save the value value associated key into a memory cache.
toString() String
A string representation of this object.
inherited
write(Key key, T? value) Future<void>
Used by Stock to write records coming in from the fetcher (network) to the source of truth.
override

Operators

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