protected override async Task OnInitializedAsync()
{
SubscribeToAction<FetchSuccessAction1>(async action =>
{
formModel = action.entity with { };
StateHasChanged();
});
SubscribeToAction<CreateSuccessAction2>(async action =>
{
formModel = action.entity with { };
StateHasChanged();
});
SubscribeToAction<UpdateSuccessAction3>(action =>
{
formModel = action.entity with { };
StateHasChanged();
});
}
<fieldset class="xo-busy-spinner_container @Class" disabled=@IsBusy>
@ChildContent
@if (IsBusy)
{
<div class="xo-busy-spinner_obscurer">
<span class="xo-busy-spinner_spinner"></span>
</div>
}
</fieldset>
disabled=true
it also disables all controls inside it, buttons, inputs, everything
Action.Customer
into state if there are multiple pieces of state holding customer information so that, for example, fetching a Customer from the server with a name that has been updated will update existing state
Ordinarily you'd take the DTO from the API, reduce its values into state, and then the form would make a copy of that state into a mutable object
The first part I understand, reducing the values into the state, but how do I make a copy of the state into a mutable object in the component?