watchData method

Stream<T?> watchData({
  1. required String key,
})

Implementation

Stream<T?> watchData({required String key}) async* {
  if (_box == null || !_box!.isOpen) {
    dev.log("Hive box was not initialized!");
    return;
  }
  yield (getData(key: key));
  yield* _box!.watch(key: key).asyncMap((e) => e.value);
}