tryAddAll method

RxResult<void> tryAddAll(
  1. Map<K, V> other
)

Add all entries with error handling

Implementation

RxResult<void> tryAddAll(Map<K, V> other) {
  return RxResult.tryExecute(() {
    if (other.isEmpty) return;
    final newMap = Map<K, V>.from(value);
    newMap.addAll(other);
    value = newMap;
  }, 'add all entries to map');
}