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

Stream.apex

  • Docs
  • Tutorials
Getting started with Stream.apex

Create Streams

We have various ways to create streams in Stream.apex.

Stream.of(1); // Create a stream with element 1
Stream.with(1, 2, 3); // Create a stream with elements 1, 2, 3
Stream.fromData(new List{ 1, 2, 3}); // Create a stream with a list of elements
Stream.range(1, 3); // Create a stream that start at 1 and creates 3 numbers
Stream.empty(); // Create an empty stream
Stream.throwError('error'); // Create a stream that throws error
Done