diff --git a/src/R3/ReactiveCommand.cs b/src/R3/ReactiveCommand.cs index 6177019..4be2fdf 100644 --- a/src/R3/ReactiveCommand.cs +++ b/src/R3/ReactiveCommand.cs @@ -27,14 +27,14 @@ public ReactiveCommand(Action execute) { this.list = new FreeListCore(this); this.canExecute = true; - this.subscription = this.Subscribe((Command: this, Action: execute), static (value, state) => state.Command.HandleExecution(value, state.Action)); + this.subscription = this.Subscribe((HandleExecutionAction: (Action>)HandleExecution, Action: execute), static (value, state) => state.HandleExecutionAction(value, state.Action)); } public ReactiveCommand(Func executeAsync, AwaitOperation awaitOperation = AwaitOperation.Sequential, bool configureAwait = true, bool cancelOnCompleted = false, int maxSequential = -1) { this.list = new FreeListCore(this); this.canExecute = true; - this.subscription = this.SubscribeAwait((Command: this, Func: executeAsync), static (value, state, cancellationToken) => state.Command.HandleAsyncExecution(value, state.Func, cancellationToken), awaitOperation, configureAwait, cancelOnCompleted, maxSequential); + this.subscription = this.SubscribeAwait((HandleAsyncExecutionFunc: (Func, CancellationToken, ValueTask>)HandleAsyncExecution, Func: executeAsync), static (value, state, cancellationToken) => state.HandleAsyncExecutionFunc(value, state.Func, cancellationToken), awaitOperation, configureAwait, cancelOnCompleted, maxSequential); } public ReactiveCommand(Observable canExecuteSource, bool initialCanExecute) @@ -529,7 +529,7 @@ public static ReactiveCommand ToReactiveCommand( { var command = new ReactiveCommand(canExecuteSource, initialCanExecute); - var subscription = command.SubscribeAwait(executeAsync, async (x, func, ct) => await func(x, ct), awaitOperation, configureAwait, cancelOnCompleted, maxSequential); + var subscription = command.SubscribeAwait(executeAsync, static async (x, func, ct) => await func(x, ct), awaitOperation, configureAwait, cancelOnCompleted, maxSequential); command.CombineSubscription(subscription); return command;