3

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?

jakub
  • 3,576
  • 3
  • 29
  • 55

0 Answers0