SimpleCachedValue<CacheContentType> class
A CachedValue that holds the last result of the computation callback since the start of the last time the cache was refresh via refresh.
As a comparison to TimeToLiveCachedValue and DependentCachedValue, it defines the most fundamental behavior of teh cache.
This cache type will only be considered invalid if invalidate is called manually (or by a SingleChildCachedValue that wraps a cache of this type).
It is recommended to be created via CachedValue's main constructor
new CachedValue
.
- Implemented types
-
- CachedValue<
CacheContentType>
- CachedValue<
- Available Extensions
Constructors
-
SimpleCachedValue(ComputeCacheCallback<
CacheContentType> _computeCache) -
Creates a SimpleCachedValue. It is recommended to use
new CachedValue
instead of this constructor.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isValid → bool
-
Check the current state of the cache.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → CacheContentType
-
Access the current cache value.
no setteroverride
Methods
-
invalidate(
) → void -
Marks the cache as invalid.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
) → CacheContentType -
Manually calls the compute update callback (given by the constructor) and
store the result on cache.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited