member_webapp/@overflow/meta/store/entity/meta-noauth-probe-status/meta-noauth-probe-status.reducer.ts

27 lines
668 B
TypeScript
Raw Normal View History

2018-05-29 10:17:16 +00:00
import { ActionType, Actions } from './meta-noauth-probe-status.action';
import {
State,
initialState,
metaNoAuthProbeStatusEntityAdapter,
} from './meta-noauth-probe-status.state';
export function reducer(state: State = initialState, action: Actions): State {
switch (action.type) {
case ActionType.ReadAll: {
return {
...state,
};
}
case ActionType.ReadAllSuccess: {
return metaNoAuthProbeStatusEntityAdapter.setAll(action.payload, state);
}
case ActionType.ReadAllFailure: {
return metaNoAuthProbeStatusEntityAdapter.setError(action.payload, state);
}
default: {
return state;
}
}
}