member_webapp/@overflow/meta/store/entity/meta-probe-status/meta-probe-status.reducer.ts
crusader 10e14d5edb ing
2018-05-29 19:17:16 +09:00

27 lines
636 B
TypeScript

import { ActionType, Actions } from './meta-probe-status.action';
import {
State,
initialState,
metaProbeStatusEntityAdapter,
} from './meta-probe-status.state';
export function reducer(state: State = initialState, action: Actions): State {
switch (action.type) {
case ActionType.ReadAll: {
return {
...state,
};
}
case ActionType.ReadAllSuccess: {
return metaProbeStatusEntityAdapter.setAll(action.payload, state);
}
case ActionType.ReadAllFailure: {
return metaProbeStatusEntityAdapter.setError(action.payload, state);
}
default: {
return state;
}
}
}