Sha256: 52310e25e36ae4cb83cfb06fbd0b5b782cc74e799b0b88fa1fd6deeed8244528

Contents?: true

Size: 523 Bytes

Versions: 6

Compression:

Stored size: 523 Bytes

Contents

import Immutable from 'seamless-immutable';
import {
  INSIGHTS_HITS_SUCCESS,
  INSIGHTS_HITS_FAILURE,
} from './InsightsTabConstants';

const initialState = Immutable({
  hits: [],
});

export default (state = initialState, action) => {
  const { payload: { hits, error } = {} } = action;

  switch (action.type) {
    case INSIGHTS_HITS_SUCCESS:
      return state.merge({
        hits,
      });
    case INSIGHTS_HITS_FAILURE:
      return state.merge({
        error,
      });
    default:
      return state;
  }
};

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_rh_cloud-0.9.12 webpack/InsightsHostDetailsTab/InsightsTabReducer.js
foreman_rh_cloud-1.0.12 webpack/InsightsHostDetailsTab/InsightsTabReducer.js
foreman_rh_cloud-2.0.12 webpack/InsightsHostDetailsTab/InsightsTabReducer.js
foreman_rh_cloud-0.9.11 webpack/InsightsHostDetailsTab/InsightsTabReducer.js
foreman_rh_cloud-1.0.11 webpack/InsightsHostDetailsTab/InsightsTabReducer.js
foreman_rh_cloud-2.0.11 webpack/InsightsHostDetailsTab/InsightsTabReducer.js