Пример #1
0
        public static UniTask <TSource> LastAsync <TSource>(this IUniTaskAsyncEnumerable <TSource> source,
                                                            CancellationToken cancellationToken = default)
        {
            Error.ThrowArgumentNullException(source, nameof(source));

            return(Last.LastAsync(source, cancellationToken, false));
        }
Пример #2
0
        public static UniTask <TSource> LastOrDefaultAwaitWithCancellationAsync <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(Last.LastAwaitWithCancellationAsync(source, predicate, cancellationToken, true));
        }