OptimisticCache class

Inheritance

Constructors

OptimisticCache({@required DataIdFromObject dataIdFromObject, String prefix: '@cache/reference', FutureOr<String> storagePrefix})

Properties

optimisticPatches ↔ List<OptimisticPatch>
@protected, read / write
data ↔ HashMap<String, dynamic>
@protected, read / write, inherited
dataIdFromObject DataIdFromObject
read / write, inherited
hashCode → int
The hash code for this object.
read-only, inherited
prefix ↔ String
read / write, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
storagePrefix → FutureOr<String>
For web/browser, storagePrefix is a prefix to the key for window.localStorage [...]
final, inherited

Methods

addOptimisiticPatch(String addId, CacheTransform transform) → void
Add a given patch using the given transform [...]
read(String key) → dynamic
Reads and dereferences an entity from the first valid optimistic layer, defaulting to the base internal HashMap.
override
removeOptimisticPatch(String removeId) → void
Remove a given patch from the list [...]
denormalizedRead(String key) → dynamic
eagerly dereferences all cache references. WARNING if your system allows cyclical references, this will break
inherited
lazilyDenormalized(Map<String, Object> data, [CacheState cacheState]) LazyCacheMap
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
reset() → void
inherited
restore() → void
inherited
save() → Future<void>
inherited
toString() → String
Returns a string representation of this object.
inherited
write(String key, Object value) → void
Writes included objects to store, replacing discernable entities with references
inherited
writeInto(String key, Object value, Map<String, Object> into, [Normalizer normalizer]) → void
Writes included objects to provided Map, replacing discernable entities with references
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited