<commit_before>/**
 * Module for Redux store related startup functions
 * @module platform/startup/store
 * @see module:platform/startup
 */
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
import thunk from 'redux-thunk';
import scheduledDowntime from '../monitoring/DowntimeNotification/reducer';
import feedback from '../site-wide/feedback/reducers';
import login from '../site-wide/user-nav/reducers';
import profile from '../user/profile/reducers';

/**
 * Reducer object containing all of the site-wide reducers
 * @type {object}
 */
export const commonReducer = {
  user: combineReducers({ login, profile }),
  feedback,
  scheduledDowntime
};

/**
 * Creates a Redux store and merges the provided reducer with commonReducer. It also
 * sets up the Redux devtools in development and adds redux-thunk as middleware.
 *
 * @param {Object} [appReducer={}] An object with reducer functions as properties
 * @returns {Store} The Redux store with a combined reducer from the commonReducer and
 * appReducer.
 */
export default function createCommonStore(appReducer = {}) {
  const reducer = Object.assign({}, appReducer, commonReducer);
  const useDevTools = __BUILDTYPE__ === 'development' && window.devToolsExtension;

  return createStore(combineReducers(reducer), compose(
    applyMiddleware(thunk), useDevTools ? window.devToolsExtension() : f => f));
}
<commit_msg>redux devtools initialization change (#7701)<commit_after>/**
 * Module for Redux store related startup functions
 * @module platform/startup/store
 * @see module:platform/startup
 */
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
import thunk from 'redux-thunk';
import scheduledDowntime from '../monitoring/DowntimeNotification/reducer';
import feedback from '../site-wide/feedback/reducers';
import login from '../site-wide/user-nav/reducers';
import profile from '../user/profile/reducers';

/**
 * Reducer object containing all of the site-wide reducers
 * @type {object}
 */
export const commonReducer = {
  user: combineReducers({ login, profile }),
  feedback,
  scheduledDowntime
};

/**
 * Creates a Redux store and merges the provided reducer with commonReducer. It also
 * sets up the Redux devtools in development and adds redux-thunk as middleware.
 *
 * @param {Object} [appReducer={}] An object with reducer functions as properties
 * @returns {Store} The Redux store with a combined reducer from the commonReducer and
 * appReducer.
 */
export default function createCommonStore(appReducer = {}) {
  const reducer = Object.assign({}, appReducer, commonReducer);
  const useDevTools = __BUILDTYPE__ === 'development' && window.__REDUX_DEVTOOLS_EXTENSION__;

  return createStore(combineReducers(reducer), compose(
    applyMiddleware(thunk), useDevTools ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
}

{'fraction_non_alphanumeric': 0.11080041943376442, 'fraction_numerical': 0.0013981125480601187, 'mean_word_length': 5.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1980949', 'n_tokens_mistral': 855, 'n_tokens_neox': 810, 'n_words': 262}