I'm currently trying to pull all my action related stuff into a StateFacade but I ran into a problem where my component needs to wait for data to load. I'm currently using SubscribeToAction to wait for my success actions but I'm wondering if there is a way to also pull this into the StateFacade.
I need my results to fill the model for my EditContext in my component.
Anyone got any ideas for this?
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();
});
}