Closed michaelstonis closed 4 months ago
I see, Blazor also seems to have a SynchronizationContext, so it may be possible to do something.
I've implemented SynchronizationContextTimeProvider for Blazor. StateHasChanged should be executed manually.
I've introduced AddBlazorR3
for default TimeProvider as request scoped.
https://github.com/Cysharp/R3?tab=readme-ov-file#blazor
I've implemented SynchronizationContextTimeProvider for Blazor. StateHasChanged should be executed manually.
I think this is great! Having StateHasChanged
called manually seems like a reasonable expectation since we don't have a better way to manage it and it would be better to be careful with how many updates we push there.
Is Blazor Support possible?
What could a
TimeProvider
look like? There is no direct dispatcher and theStateHasChanged
method is not very granular. I could still see there being a benefit in having something to automatically callStateHasChanged
based on property updates or similar though.