CachedStorage<E> class

Storage implementation wrapper that adds in-memory cache functionality.

Use it to wrap time consuming or performance heavy storage implementations.

Implemented types

Constructors

CachedStorage(Storage<E> _inner)

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

clearCache() → void
Clears only the cached value.
delete() Future<void>
Deletes both actual and cached value. On error throws.
override
get() Future<E?>
Gets the item, uses the cached version if present. Otherwise, fetches a fresh value, caches, and returns it. On error throws.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(E item) Future<E>
Saves and caches the item. On error throws.
override
toString() String
A string representation of this object.
inherited

Operators

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