Streams
As its name suggests, a Stream is simply a stream of data that your app can react to. For example, a stream is used to allow your app to respond to user authentication changes, which we will explore, in further detail, in Chapter 9, Popular Third-Party Plugins. That stream shares updates to a user's authentication status. To use the stream, you register to listen to the Stream instance and supply a function that will be called when there is new data added to the stream.
Throughout third-party plugins, especially Firebase plugins, you will see the regular use of streams so that the plugins can effectively call back into your code to tell you something has changed. They are very similar in concept to the use of a callback method, which is passed to the data source and called on data changes.
As a very brief example to give context to this idea, let's take a look at an example of a stream that gives updates when the weather forecast changes. Let's suppose...