reducer.ts 409 B

12345678910111213141516
  1. import { Action } from 'redux/interfaces';
  2. import { Cluster } from 'generated-sources';
  3. import ActionType from 'redux/actionType';
  4. export const initialState: Cluster[] = [];
  5. const reducer = (state = initialState, action: Action): Cluster[] => {
  6. switch (action.type) {
  7. case ActionType.GET_CLUSTERS__SUCCESS:
  8. return action.payload;
  9. default:
  10. return state;
  11. }
  12. };
  13. export default reducer;