member_webapp/@overflow/probe/store/container/probe-detail/probe-detail.reducer.ts
2018-05-26 18:08:40 +09:00

37 lines
650 B
TypeScript

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;
}
}
}