Watching data in Hive database with RxDart

728 Views Asked by At

I’m using Hive and RxDart Is there a better way of emitting values from my Hive box than

  Stream<List<Tissue>> watchTissues() {
    return tissueBox
        .watch()
        .map((event) => getTissues())
        .startWith(getTissues());
  }  

  List<Tissue> getTissues() {
    return List<Tissue>.from(tissueBox.values);
  }

It works but looks too verbose to me, so wondering if there is a better way?

0

There are 0 best solutions below