member_webapp/@overflow/probe/store/container/probe-detail/probe-detail.reducer.ts

37 lines
650 B
TypeScript
Raw Normal View History

2018-05-26 09:08:40 +00:00
import { ActionType, Actions } from '../../entity/probe';
import {
State,
initialState,
} from './probe-detail.state';
import { Probe } from '@overflow/commons-typescript/model/probe';
export function reducer(state = initialState, action: Actions): State {
switch (action.type) {
case ActionType.Read: {
return {
...state,
pending: true,
};
}
case ActionType.ReadSuccess: {
return {
...state,
pending: false,
};
}
case ActionType.ReadFailure: {
return {
...state,
pending: true,
};
}
default: {
return state;
}
}
}