Blazor Webassembly - StateAsChanged not fire using IAsyncEnumerable #43098
Labels
area-blazor
Includes: Blazor, Razor Components
feature-blazor-wasm
This issue is related to and / or impacts Blazor WebAssembly
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
question
Status: Resolved
Is there an existing issue for this?
Describe the bug
Hello,
I am trying to use a controller that returns an IAsyncEnumerable from a webassembly Razor application.
In this repo https://github.com/GLuca74/TestBlazorWebAssembyIAsyncEnumerable there is a simply Web Api Application with the WeatherForecastController that have the Get method that resutrns 1 milion of int as IAsyncEnuverable
In the Balzor webassembly application, the counter Page contain the code that use the controller :
When the data is loaded, only one update of the UI is performed and the page remain locked. But if I call await Task.Delay(1) before call StateHasChanged all works and any update of the UI is performed.
Can I ask why the Delay is needed to let it works or wath is wrong with my code?
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: