Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/ReactiveUI.Tests/Commands/ReactiveCommandTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1811,14 +1811,27 @@ await Task.Delay(
fixture.ThrownExceptions.Subscribe(_ => { });

var latestIsExecutingValue = false;
var subscriptionReady = new TaskCompletionSource<bool>();
var isFirstValue = true;

fixture.IsExecuting.Subscribe(isExec =>
{
statusTrail.Add((position++, $"command executing = {isExec}"));
Volatile.Write(
ref latestIsExecutingValue,
isExec);

// Signal that we've received the first value (should be false initially)
if (isFirstValue)
{
isFirstValue = false;
subscriptionReady.TrySetResult(true);
}
});

// Wait for the subscription to receive the initial value
await subscriptionReady.Task;

var disposable = fixture.Execute().Subscribe();

// Phase 1
Expand Down
Loading