Sha256: 8ceeac11b8ec50146f79a17a6563a1d63703899ce2a8f144498f97831d50c3c8

Contents?: true

Size: 550 Bytes

Versions: 105

Compression:

Stored size: 550 Bytes

Contents

import Immutable from 'seamless-immutable';
import {
  INSIGHTS_SYNC_SETTING_SET,
  INSIGHTS_SYNC_SETTINGS_GET_SUCCESS,
} from './InsightsSettingsConstants';

const initialState = Immutable({
  insightsSyncEnabled: false,
});

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

  switch (action.type) {
    case INSIGHTS_SYNC_SETTINGS_GET_SUCCESS:
    case INSIGHTS_SYNC_SETTING_SET:
      return state.merge({
        ...state,
        ...settings,
      });
    default:
      return state;
  }
};

Version data entries

105 entries across 105 versions & 1 rubygems

Version Path
foreman_rh_cloud-6.0.42 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.41 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.39 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.38 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-4.0.35 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.37 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.36 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.35 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.34 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.33 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-3.0.32 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-4.0.32 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.32 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-4.0.31 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.31 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.30 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-4.0.30 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-3.0.29 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-4.0.29 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-5.0.29 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js