<PackageReference Include="ReactiveUI.Primitives" Version="10.2.0" />

ReactiveUI.Primitives.Advanced.TaskAnyWitness<T>

public sealed class TaskAnyWitness<T> : IObserver<T>, IDisposable
Task-producing terminal sink that completes with whether a source produced a matching value.
public Task<bool> Task { get; }

Gets the task completed by this sink.

public TaskAnyWitness(CancellationToken cancellationToken)

Initializes a new instance of the TaskAnyWitness<T> class.

public TaskAnyWitness(Func<T, bool> predicate, CancellationToken cancellationToken)

Initializes a new instance of the TaskAnyWitness<T> class.

public static Task<bool> AnyAsync(IObservable<T> source)

Subscribes to source and completes with whether any value was observed.

public static Task<bool> AnyAsync(IObservable<T> source, CancellationToken cancellationToken)

Subscribes to source and completes with whether any value was observed.

public static Task<bool> AnyAsync(IObservable<T> source, Func<T, bool> predicate)

Subscribes to source and completes with whether any value matched predicate.

public static Task<bool> AnyAsync(IObservable<T> source, Func<T, bool> predicate, CancellationToken cancellationToken)

Subscribes to source and completes with whether any value matched predicate.

public void Dispose()

public void OnCompleted()

public void OnError(Exception error)

public void OnNext(T value)

public void RegisterCancellation()

Registers cancellation after construction.

public void SetSubscription(IDisposable subscription)

Assigns the source subscription.