public static ReactiveCommandBase <TParam, TResult> LogThrownExceptions <TParam, TResult>(this ReactiveCommandBase <TParam, TResult> command, CompositeDisposable disposables) { command .ThrownExceptions .SubscribeSafe(LogException) .DisposeWith(disposables); return(command); }
/// <summary> /// A utility method that will pipe an Observable to an ICommand (i.e. /// it will first call its CanExecute with the provided value, then if /// the command can be executed, Execute() will be called). /// </summary> /// <typeparam name="T">The type.</typeparam> /// <typeparam name="TResult">The result type.</typeparam> /// <param name="item">The source observable to pipe into the command.</param> /// <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) => command is null ? throw new ArgumentNullException(nameof(command))
public static IDisposable ExecuteNow <TParam, TResult>(this ReactiveCommandBase <TParam, TResult> source, TParam param, CompositeDisposable disposable) { return(source.Execute(param).SubscribeSafe().DisposeWith(disposable)); }