public async Task HandleCreateClusterAction(CreateClusterAction action, IDispatcher dispatcher) { try { var clusterReactionResult = await clusterService.CreateClustersAsync(action.Request); if (clusterReactionResult) { dispatcher.Dispatch(new FetchClustersAction()); } } catch (Exception e) { dispatcher.Dispatch(new CreateClusterFailureAction(e.Message)); } }
public static ClusterState ReduceCreateClusterAction(ClusterState state, CreateClusterAction _) => new ClusterState(state.Clusters, state.Cluster, true, null);