watch method

  1. @override
Stream<Map<String, dynamic>?> watch(
  1. String dataId, {
  2. bool distinct = true,
})
override

Implementation

@override
Stream<Map<String, dynamic>?> watch(String dataId, {bool distinct = true}) {
  final stream = box
      .watch(key: dataId)
      .map<Map<String, dynamic>?>(
          (event) => event.value == null ? null : Map.from(event.value))
      .startWith(get(dataId));

  if (distinct) {
    return stream.distinct(_jsonEquals);
  }
  return stream;
}