singleOrDefault method

Observable<T> singleOrDefault({
  1. required T tooFew,
  2. required T tooMany,
})

Emits the single element of this Observable, or emits tooFew if there was no element, or emits tooMany if there was more than 1 element.

Implementation

Observable<T> singleOrDefault({required T tooFew, required T tooMany}) =>
    singleOrElse(
      tooFew: constantFunction0(tooFew),
      tooMany: constantFunction0(tooMany),
    );