Reactive nprogramming Flashcards
(5 cards)
What are streams and how are they controlled in flutter?
It is like a pipe with 2 ends only alowing to insert something to the stream and the data flows to the other end.
The pipe is called a Stream
To control the Stream, we usually use a StreamController
To insert something into the Stream, the StreamController exposes the “entrance”, called a StreamSink, accessible via the sink property
The way out of the Stream, is exposed by the StreamController via the stream property
What can be conveyed by a Stream?
Everything and anything. From a value, an event, an object, a collection, a map, an error or even another Stream, any type of data may be conveyed by a Stream.
What is a single-subscripton stream?
This type of Stream only allows a single listener during the whole lifetime of that Stream.
It is not possible to listen twice on such Stream, even after the first subscription has been canceled.
What is a broadcast stream?
What is a broadcast stream?