CacheService<D extends Object, P extends Object> class abstract

Interface to cache an Entity locally Cache should notify subscribers that data has been updated through getData channel D Data type P Params that identify data type

Constructors

CacheService.withAsyncDelegate(AsyncCacheDelegate<D, P> delegate)
Creates a AsyncCacheDelegate cache service delegate Delegate that synchronously performs caching actions
factory
CacheService.withSyncDelegate(SyncCacheDelegate<D, P> delegate)
Creates a SyncCacheDelegate cache service delegate Delegate that synchronously performs caching actions
factory

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(P params) Future<void>
Deletes cached value. The getData observable for the same key will emit null. params Caching key
getData(P params) Stream<Entity<D>?>
Subscribes to cache data updates. Cache update listeners with new cached values. params Params to notify of changes
invalidate(P params) Future<void>
Invalidates cached value params Params that identify entity
invalidateAll() Future<void>
Invalidates all cached values
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refetch(P params) Future<void>
Makes cache service to refetch cached data updating subscribers with params params Params that identify entity
refetchAll() Future<void>
Makes cache service to refetch cached data for all active subscribers
save(P params, Entity<D> entity) Future<void>
Saves entity in a cache params Params that identify entity entity Data to save
toString() String
A string representation of this object.
inherited

Operators

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