tryUpdateAll method

RxResult<void> tryUpdateAll(
  1. V update(
    1. K key,
    2. V value
    )
)

Update all values with error handling

Implementation

RxResult<void> tryUpdateAll(V Function(K key, V value) update) {
  return RxResult.tryExecute(() {
    final newMap = Map<K, V>.from(value);
    newMap.updateAll(update);
    value = newMap;
  }, 'update all map values');
}