public async Task FetchWeatherForecastAsync() { dispatcher.Dispatch(new WeatherForecastFetchStartAction()); try { var forecasts = await http.GetJsonAsync <WeatherForecast[]>("/sample-data/weather.json"); // simulate slow network await Task.Delay(5000); dispatcher.Dispatch(new WeatherForecastFetchSuccessAction(forecasts)); } catch (Exception ex) { dispatcher.Dispatch(new WeatherForecastFetchFailureAction(ex.Message)); } }
public void Dispatch(IReduxMessage message, IReduxDispatcher next) { if (next is null) { throw new ArgumentNullException(nameof(next)); } if (message is SpeakMessage speak) { Speak(speak.TextToSay); } next.Dispatch(message); }
public void Dispatch(IReduxMessage message, IReduxDispatcher next) { LastCapturedMessage = message; next.Dispatch(message); }