Sha256: 8ceeac11b8ec50146f79a17a6563a1d63703899ce2a8f144498f97831d50c3c8

Contents?: true

Size: 550 Bytes

Versions: 103

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

103 entries across 103 versions & 1 rubygems

Version Path
foreman_rh_cloud-11.0.3 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-9.0.59 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-11.0.2 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-11.0.1 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-11.0.0 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-9.0.58 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-10.0.2 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-9.0.57 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-10.0.1 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-9.0.56 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-9.0.55 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-9.0.54 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-9.0.53 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-9.0.52 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-8.0.52 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-9.0.51 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-8.0.51 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-7.0.48 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-7.0.47 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js
foreman_rh_cloud-8.0.50 webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettingsReducer.js