ValueStream<T>.seeded constructor

ValueStream<T>.seeded(
  1. T initialValue, {
  2. void onListen()?,
  3. FutureOr<void> onCancel()?,
  4. bool sync = false,
})

Constructs a ValueStream with an initial value.

See ValueStream.new

Implementation

factory ValueStream.seeded(T initialValue,
    {void Function()? onListen,
    FutureOr<void> Function()? onCancel,
    bool sync = false}) {
  final res =
      ValueStream<T>(onListen: onListen, onCancel: onCancel, sync: sync);
  res.add(initialValue);
  return res;
}