• 1Installation
  • 2Preliminary Knowledge
  • 3Create Streams
  • 4Subscription
  • 5Lazy Streams
  • 6Stream Operations
  • 7Subjects

Stream.apex

  • Docs
  • Tutorials
Getting started with Stream.apex

Lazy Streams

Streams are lazy and will not emit events until you actually subscribe them.

Stream.with(1, 2, 3) // Will not emit events
    .subscribe(R.debug); // Will emit events

This kind of streams have the data within them, and when one observer subscribes them, they will emit data to this observer, including all the events. When a new observer subscribes, the same data will be emitted. Hence streams are just like working only for these subscribed observers alone. They unicast events to observers and are called cold streams.

Done