| Index: pkg/observe/lib/src/observable_map.dart
|
| diff --git a/pkg/observe/lib/src/observable_map.dart b/pkg/observe/lib/src/observable_map.dart
|
| index 2cd64d57d1b52749b4cac6a6b5b47e524cea709b..621c86fa5afc413a2a4dea5cb009909153b93bb8 100644
|
| --- a/pkg/observe/lib/src/observable_map.dart
|
| +++ b/pkg/observe/lib/src/observable_map.dart
|
| @@ -67,9 +67,7 @@ class ObservableMap<K, V> extends ChangeNotifierBase implements Map<K, V> {
|
| * you should use [toObservable].
|
| */
|
| factory ObservableMap.from(Map<K, V> other) {
|
| - var result = new ObservableMap<K, V>._createFromType(other);
|
| - other.forEach((key, value) { result[key] = value; });
|
| - return result;
|
| + return new ObservableMap<K, V>._createFromType(other)..addAll(other);
|
| }
|
|
|
| factory ObservableMap._createFromType(Map<K, V> other) {
|
| @@ -114,6 +112,10 @@ class ObservableMap<K, V> extends ChangeNotifierBase implements Map<K, V> {
|
| }
|
| }
|
|
|
| + void addAll(Map<K, V> other) {
|
| + other.forEach((K key, V value) { this[key] = value; });
|
| + }
|
| +
|
| V putIfAbsent(K key, V ifAbsent()) {
|
| int len = _map.length;
|
| V result = _map.putIfAbsent(key, ifAbsent);
|
|
|