Exemplo n.º 1
0
        public static UniTask <TSource> SingleAsync <TSource>(this IUniTaskAsyncEnumerable <TSource> source,
                                                              CancellationToken cancellationToken = default)
        {
            Error.ThrowArgumentNullException(source, nameof(source));

            return(SingleOperator.SingleAsync(source, cancellationToken, false));
        }
Exemplo n.º 2
0
        public static UniTask <TSource> SingleOrDefaultAwaitWithCancellationAsync <TSource>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, CancellationToken, UniTask <Boolean> > predicate, CancellationToken cancellationToken = default)
        {
            Error.ThrowArgumentNullException(source, nameof(source));
            Error.ThrowArgumentNullException(predicate, nameof(predicate));

            return(SingleOperator.SingleAwaitWithCancellationAsync(source, predicate, cancellationToken, true));
        }