evict method
void
evict(
- String entityId, {
- String? fieldName,
- Map<
String, dynamic> args = const {}, - OperationRequest? optimisticRequest,
Removes the entity from the Store as well as from any optimistic patches.
You can retrieve an entityId
by calling Cache.identify.
If a fieldName
is provided, only that field will be removed. If an
args
Map is provided, only fields that include matching values for
each arg will be removed.
If an optimisticRequest
is provided, the changes will be written as an
optimistic patch and will be reverted once a non-optimistic response is
received for the optimisticRequest
.
Implementation
void evict(
String entityId, {
String? fieldName,
Map<String, dynamic> args = const {},
OperationRequest? optimisticRequest,
}) =>
fieldName == null
? _evictEntity(
entityId,
optimisticRequest,
)
: _evictField(
entityId,
fieldName,
args,
optimisticRequest,
);