-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Greetings, I'm trying to modify my application store class starting from a PeriodicTimer in Blazor, then I call a service which makes the httpcalls and updates the store class (both the Synchronize method and the AppStore method that receives the new value in the state class are marked with the Action), however, the UI is not being updated.
My blazor component has the Observer attribute in place
[Action]
async Task HandleTimerAsync(PeriodicTimer timer, CancellationToken cancel = default)
{
try
{
while (await timer.WaitForNextTickAsync(cancel))
{
await synchronizer. Synchronize();
await InvokeAsync(() => StateHasChanged());
}
}
catch (Exception)
{
//Handle the exception but don't propagate it
}
}
Has anybody done something like this on a backgroundservice or timer?
Thanks in advance,
Geo
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels