DEV Community

Discussion on: Explain Futures and Streams in Dart like I'm Five

Collapse
 
allanjeremy profile image
Allan N Jeremy

Streams are to Dart, what Events are to JavaScript.

This!! This right here clarified the streams concept. Thanks.

In the case of streaming each key in the code sample, where would you generally use the stream? Since in this case I assume the split() is similar to the js one, so it'd do that synchronously. The example does clarify the concept, I'm just curious as to what use cases there would be

Collapse
 
creativ_bracket profile image
Jermaine • Edited

Hey @allanjeremy , this stream has several applications. For example on the UI you could be simulating a text typing effect. See this DartPad for example.

Thread Thread
 
allanjeremy profile image
Allan N Jeremy

Hey Jermaine, thanks for sharing. Managed to wrap my head around the concept through all the great responses