public static UniTask <Dictionary <TKey, TSource> > ToDictionaryAwaitWithCancellationAsync <TSource, TKey>(this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, CancellationToken, UniTask <TKey> > keySelector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); return(ToDictionary.ToDictionaryAwaitWithCancellationAsync(source, keySelector, EqualityComparer <TKey> .Default, cancellationToken)); }
ToDictionaryAwaitWithCancellationAsync <TSource, TKey, TElement>( this IUniTaskAsyncEnumerable <TSource> source, Func <TSource, CancellationToken, UniTask <TKey> > keySelector, Func <TSource, CancellationToken, UniTask <TElement> > elementSelector, IEqualityComparer <TKey> comparer, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); return(ToDictionary.ToDictionaryAwaitWithCancellationAsync(source, keySelector, elementSelector, comparer, cancellationToken)); }