RxMap<K, V> constructor

  1. @Deprecated('Collections, Futures and Streams will no longer be ' 'supported by this package as they violate the ASP standard. ' 'It is better to use a pure [Atom] synchronously ' 'to understand the flow of reactivity.')
RxMap<K, V>([
  1. Map<K, V>? map,
  2. String? key
])

Creates a RxMap that may be initialized with a map. {@tool snippet}

final map = RxMap({'name': 'jacob'});

{@end-tool}

Implementation

@Deprecated('Collections, Futures and Streams will no longer be '
    'supported by this package as they violate the ASP standard. '
    'It is better to use a pure [Atom] synchronously '
    'to understand the flow of reactivity.')
RxMap([Map<K, V>? map, String? key]) {
  this.key = key ?? 'RxList:$hashCode';

  if (map != null) {
    _map = map;
  } else {
    _map = {};
  }
}