2021-05-14 08:06:16 +00:00
|
|
|
# angel3_merge_map
|
2021-05-15 06:12:55 +00:00
|
|
|
[](https://pub.dartlang.org/packages/angel3_merge_map)
|
2021-05-14 08:06:16 +00:00
|
|
|
[](https://dart.dev/null-safety)
|
2021-05-15 06:01:47 +00:00
|
|
|
[](https://gitter.im/angel_dart/discussion)
|
2021-05-14 08:06:16 +00:00
|
|
|
|
2021-05-14 10:34:09 +00:00
|
|
|
[](https://github.com/dukefirehawk/angel/tree/angel3/packages/merge_map/LICENSE)
|
2021-05-14 08:06:16 +00:00
|
|
|
|
2021-03-18 23:10:19 +00:00
|
|
|
Combine multiple Maps into one. Equivalent to
|
|
|
|
[Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
|
|
|
|
in JS.
|
|
|
|
|
|
|
|
# Example
|
|
|
|
|
|
|
|
```dart
|
2021-05-14 08:06:16 +00:00
|
|
|
import "package:angel3_merge_map/angel3_merge_map.dart";
|
2021-03-18 23:10:19 +00:00
|
|
|
|
2021-05-14 08:06:16 +00:00
|
|
|
void main() {
|
2021-03-18 23:10:19 +00:00
|
|
|
Map map1 = {'hello': 'world'};
|
|
|
|
Map map2 = {'foo': {'bar': 'baz', 'this': 'will be overwritten'}};
|
|
|
|
Map map3 = {'foo': {'john': 'doe', 'this': 'overrides previous maps'}};
|
|
|
|
Map merged = mergeMap(map1, map2, map3);
|
|
|
|
|
|
|
|
// {hello: world, foo: {bar: baz, john: doe, this: overrides previous maps}}
|
|
|
|
}
|
|
|
|
```
|