public async Task HandleGetCustomerForEditAction(GetCustomerForEditAction action, IDispatcher dispatcher) { Console.WriteLine("Getting customer with Id: 42"); await Task.Delay(1000); string jsonFromServer = $"{{\"Id\":42,\"RowVersion\":\"AQIDBAUGBwgJCgsMDQ4PEA==\",\"Name\":\"Our first customer\"}}"; var objectFromServer = JsonConvert.DeserializeObject <CustomerEdit>(jsonFromServer); dispatcher.Dispatch(new GetCustomerForEditResultAction(objectFromServer)); }
public static EditCustomerState Reduce(EditCustomerState state, GetCustomerForEditAction action) => new EditCustomerState(isLoading: true);