Skip to content

Commit

Permalink
Use IReactiveCommand<T, TResult>
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperJMN committed Nov 26, 2023
1 parent 23334c1 commit d52fef4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ReactiveUI/ReactiveCommand/ReactiveCommandMixins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ public static IDisposable InvokeCommand<T>(this IObservable<T> item, ICommand? c
/// <param name="command">The command to be executed.</param>
/// <returns>An object that when disposes, disconnects the Observable
/// from the command.</returns>
public static IDisposable InvokeCommand<T, TResult>(this IObservable<T> item, ReactiveCommandBase<T, TResult>? command) =>
public static IDisposable InvokeCommand<T, TResult>(this IObservable<T> item, IReactiveCommand<T, TResult>? command) =>
command is null
? throw new ArgumentNullException(nameof(command))
: WithLatestFromFixed(item, command.CanExecute, (value, canExecute) => new InvokeCommandInfo<ReactiveCommandBase<T, TResult>, T>(command, canExecute, value))
: WithLatestFromFixed(item, command.CanExecute, (value, canExecute) => new InvokeCommandInfo<IReactiveCommand<T, TResult>, T>(command, canExecute, value))
.Where(ii => ii.CanExecute)
.SelectMany(ii => command.Execute(ii.Value).Catch(Observable<TResult>.Empty))
.Subscribe();
Expand Down

0 comments on commit d52fef4

Please sign in to comment.