Closed opringle closed 4 years ago
The simplest way would be changing to Observable.combineLatest2
and inside the combiner
function you would have to build your own QuerySnapshot
that handles changing to DocumentChangeType.modified
, but that's actually hard to catch since it'll be two DocumentChange
and I don't know how often they'll come together, or if they'll be separate QuerySnapshot
instances; my suggestion here would be changing your UI to having a TabBar where the user can select either Active or Inactive and each of those would have their own FirestoreAnimatedList
without having to worry on merging.
Actually I'm closing this since #16 made it so you can't use Stream<QuerySnapshot>
directly anymore, so this isn't doable.
I have two separate firestore queries I want to combine and use in a single
FirestoreAnimatedList
. I am combining my streams using a streamgroup.When a user's status changes from "active" to "inactive" I want the FirestoreAnimatedList to trigger
onDocumentChanged
. However, instead the querysnapshot shows that a document was removed fromactiveUsers
and a document was added toinactiveUsers
, resulting in the list callingonDocumentAdded
&onDocumentRemoved
in rapid succession.Here is a simple example:
Is there a way I can produce a combined
Stream<QuerySnapshot>
that returnsDocumentChangeType.modified
instead? What is the simplest way to achieve my desired functionality?