Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IsExecuting to AsyncReactiveCommand #496

Conversation

kenichi-kobayashi
Copy link

コマンド実行中を示すIsExecutingを、AsyncReactiveCommandに追加しました。

ご確認ください。

@kenichi-kobayashi
Copy link
Author

ツイッターにて、提案してくれた方法があったので、そちらを採用してみたいと思います。

一旦、棄却します。

@runceel
Copy link
Owner

runceel commented Nov 4, 2024

おそらく、コマンドから実行されるメソッドにフラグのオンオフをつけたほうがいいような気がします。
例えば BusyNotifier を使えばこんな感じで管理できます。

BusyNotifier isExecuting = new();

async Task SomeMethodAsync()
{
  if (isExecuting.IsBusy) return;
  using var executing = isExecuting.ProcessStart();
  // do something
}

isExecuting.Subscribe(x => Console.WriteLine($”is executing: {x}));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants