Effect<Value>.stream constructor
const
Effect<Value>.stream ({
- required Stream<
Value> stream, - Value onDone()?,
- Value onError(
- Object error,
- StackTrace stackTrace
- 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>;