Comments (5)
We have a test covering this - there is not problem in general merging two streams.
async/test/stream_group_test.dart
Lines 17 to 34 in 08e8836
Perhaps your stream is a broadcast Stream? Those events are explicitly not buffered and so any events that come through before you have a listener on the group's stream will be lost.
async/test/stream_group_test.dart
Lines 104 to 116 in 08e8836
You might find the SingleSubscriptionStreamTransformer
useful to convert a broadcast Stream to a single subscription stream and buffer events until there is a listener.
from async.
this this stackoverflow tracks the issue https://stackoverflow.com/questions/51214217/combine-streams-from-firestore-in-flutter
from async.
Turns out that this issue also affects the RX Observable
https://stackoverflow.com/questions/51368676/flutter-stream-builder-does-not-work-correctly-when-it-is-fed-with-observable1/52843628#52843628
from async.
Turns out that this issue also affects the RX Observable
Note that package:rxdart
does not depend on package:async
and has a completely independent implementation. If there were a bug here it would not impact that package. This is another signal that the problem is coming from the input streams, not the merging.
from async.
Update, Observable did pass both stream contents to the function as tested with
streamGroup.map((convert){ convert.documents.forEach((f){print(f.data["name"]);});}).listen(print);
however the Flutter streamBuilder widget failed to update the UI with both values.
Conclusion issue is not in the stream merging, but in displaying the content to the UI.
Thanks @natebosch for your timely response.
from async.
Related Issues (20)
- Change the default of `propagateCancel` argument in CancelableOperation.then HOT 2
- Reset method for AsyncMemoizer HOT 1
- Make it easier to safely hold a reference that can cancel an operation without holding the whole operation HOT 1
- Clarify `StreamQueue.next` will fail just after `hasNext` in API document.
- Consider to make second invocation of `streamQueue.hasNext` be postponed concluding the result until the first invocation of `q.next` , unless the stream is closed. HOT 6
- Deprecate StreamQueue.hasNext and StreamQueue.next
- Future.wait() but with Records HOT 4
- Bad State error while trying to reject a StreamQueueTransaction
- Dart 3 incompatibilty: `DelegatingStream<T> extends StreamView` but `StreamView` is `base class` HOT 5
- Add `whereNotNull` for `Stream`
- CancelableOperation value is not propagating errors, so they cannot be catched and app is crashing HOT 3
- There should be cancellable versions of Stream.firstWhere etc.
- Migrate the Result type to sealed classes HOT 2
- Make `ParallelWaitError` Include Error Details HOT 1
- Async Cache is caching exceptions HOT 5
- AsyncMemoizer is caching exceptions HOT 2
- Add an API wrapping runZonedGuarded that surfaces the first error HOT 4
- Clarify `CancelableOperation` docs HOT 4
- Inconsistent behavior of `Stream.listen` on broadcast streams HOT 1
- [Proposal] Add a CountDownLatch implementation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async.