updateCacheBatch method

void updateCacheBatch(
  1. List<String> mutatedKeys,
  2. Map<String, dynamic> mutatedData, {
  3. bool emitEvent = true,
})

Batch update Where key -> newData in the mutatedData

Implementation

void updateCacheBatch(
  List<String> mutatedKeys,
  Map<String, dynamic> mutatedData, {

  /// To make the rebuild where the query is instantiated
  bool emitEvent = true,
}) {
  mutatedData.forEach((key, value) {
    _cacheStorage.addToCache(key, value);
  });

  if (emitEvent) {
    _mutationController.add(
      CacheMutationEvent(mutatedKeys: mutatedKeys, mutatedData: mutatedData),
    );
  }
}