RxSet<T> 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.')
RxSet<T>([
  1. Set<T>? set,
  2. String? key
])

Creates a RxSet that may be initialized with a set. {@tool snippet}

final set = RxSet({'jacob', 'sara'});

{@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.')
RxSet([Set<T>? set, String? key]) {
  this.key = key ?? 'RxList:$hashCode';

  if (set != null) {
    _set = set;
  } else {
    _set = {};
  }
}