Effect<Value>.stream constructor

const Effect<Value>.stream({
  1. required Stream<Value> stream,
  2. Value onDone()?,
  3. Value onError(
    1. Object error,
    2. StackTrace stackTrace
    )?,
  4. bool? cancelOnError,
})

Bridges any Dart Stream into the effect system. Emissions, completion, and errors are forwarded through the provided callbacks.

Example:

final fromStream = Effect.stream(stream: controller.stream);

Implementation

const factory Effect.stream({
  required Stream<Value> stream,
  Value Function()? onDone,
  Value Function(Object error, StackTrace stackTrace)? onError,
  bool? cancelOnError,
}) = StreamEffect<Value>;