Add form component, redux devtools and fix reducers

This commit is contained in:
James Greenaway
2019-01-30 18:07:47 +00:00
parent 9e0cd0304e
commit 759fec17f3
11 changed files with 105 additions and 21 deletions

View File

@@ -1,3 +1,3 @@
export * from './reducers';
export * from './reducer';
export * from './actions';
export * from './epics';

View File

@@ -12,6 +12,6 @@ export interface State {
workloads: WorkloadsState;
}
export const reducers = combineReducers<State, Action>({
export const reducer = combineReducers<State, Action>({
workloads: workloadReducer,
});

View File

@@ -2,7 +2,7 @@ import { combineEpics, Epic, ofType } from 'redux-observable';
import { map, tap, ignoreElements } from 'rxjs/operators';
import { Action } from '../actions';
import { State } from '../reducers';
import { State } from '../reducer';
type AppEpic = Epic<Action, Action, State>;

View File

@@ -1,5 +1,5 @@
export * from './types';
export * from './actions';
export * from './reducers';
export * from './reducer';
export * from './epics';
export * from './services';

View File

@@ -19,6 +19,7 @@ export const reducer = (state: State = initialState, action: Action): State => {
switch (action.type) {
case 'WORKLOAD_CREATED':
return {
...state,
[action.payload.id]: {
id: action.payload.id,
complexity: action.payload.complexity,
@@ -29,6 +30,7 @@ export const reducer = (state: State = initialState, action: Action): State => {
case 'WORKLOAD_CANCEL':
return {
...state,
[action.payload.id]: {
...state[action.payload.id],
status: 'CANCELED',
@@ -37,6 +39,7 @@ export const reducer = (state: State = initialState, action: Action): State => {
case 'WORKLOAD_UPDATE_STATUS':
return {
...state,
[action.payload.id]: {
...state[action.payload.id],
status: action.payload.status,