putAndUpdateExisting method

Future<void> putAndUpdateExisting(
  1. TKey key,
  2. T newValue,
  3. void mutateExisting(
    1. TKey key,
    2. T? mutateMe,
    3. T newValueReadOnly
    )
)
inherited

Same as put, but instead of removing old object, changes (mutates) its values to newValue

Implementation

Future<void> putAndUpdateExisting(
  TKey key,
  TVal newValue,
  void Function(TKey key, TVal? mutateMe, TVal newValueReadOnly)
      mutateExisting,
) async {
  await putAllAndUpdateExisting({key: newValue}, mutateExisting);
}