You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How would I go about do something like this:
State A updates
If State A value is X I want to do a async call to server
If server response is Ok, I want to update State B
CounterState CounterState {
get {
var state = GetState<CounterState>();
if (state.Count > 10) {
var response = await ApiCall.IsCounterFull(10);
if (response.Success) {
Mediator.Send(new CounterState.CounterIsFullAction());
}
}
return state;
}
}
Which is not possible but I hope it it explains what I am trying to do.
Also, I am at the border of my knowledge so I might be going about this in a very strange way, if so, please tell :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi
How would I go about do something like this:
State A updates
If State A value is X I want to do a async call to server
If server response is Ok, I want to update State B
Code to make some sense
From the example https://timewarpengineering.github.io/blazor-state/Tutorial.html
CounterState CounterState => GetState<CounterState>();
Into
Which is not possible but I hope it it explains what I am trying to do.
Also, I am at the border of my knowledge so I might be going about this in a very strange way, if so, please tell :)
Beta Was this translation helpful? Give feedback.
All reactions