Flutter merge two firestore streams into a single stream

前端 未结 4 1939
半阙折子戏
半阙折子戏 2021-01-03 08:31

I simply want to perform an \'OR\' operation and get the both results of two queries into one stream.

Here\'s my code with a single stream

 StreamBui         


        
4条回答
  •  悲&欢浪女
    2021-01-03 09:22

    I’m not sure why you’re using forEach and Observable.just().

    You can just merge two firestore streams directly like:

    Observable.merge([stream1, stream2]).pipe(combineStream);

    Wherre stream1/2 is just your firestore snapshot.

提交回复
热议问题