<commit_before>import { configureStore } from '@reduxjs/toolkit';
import { routerMiddleware } from 'connected-react-router';
import { createBrowserHistory, createMemoryHistory } from 'history';
import { addToast } from 'app/actions/ToastActions';
import createRootReducer from 'app/store/createRootReducer';
import loggerMiddleware from 'app/store/middleware/loggerMiddleware';
import createMessageMiddleware from 'app/store/middleware/messageMiddleware';
import promiseMiddleware from 'app/store/middleware/promiseMiddleware';
import createSentryMiddleware from 'app/store/middleware/sentryMiddleware';
import type { GetCookie } from 'app/types';
import type { History } from 'history';

export const history: History = __CLIENT__
  ? createBrowserHistory()
  : createMemoryHistory();

const createStore = (
  initialState = {},
  {
    Sentry,
    getCookie,
  }: {
    Sentry?: any;
    getCookie?: GetCookie;
  } = {}
) => {
  const store = configureStore({
    preloadedState: initialState,
    reducer: createRootReducer(history),
    middleware: (getDefaultMiddleware) =>
      getDefaultMiddleware({
        thunk: {
          extraArgument: {
            getCookie,
          },
        },
      })
        .prepend(promiseMiddleware())
        .concat(
          [
            routerMiddleware(history),
            createMessageMiddleware(
              (message) =>
                addToast({
                  message,
                }),
              Sentry
            ),
            Sentry && createSentryMiddleware(Sentry),
            __CLIENT__ &&<commit_msg>Ignore actions in serializable check<commit_after>import { configureStore } from '@reduxjs/toolkit';
import { routerMiddleware } from 'connected-react-router';
import { createBrowserHistory, createMemoryHistory } from 'history';
import { addToast } from 'app/actions/ToastActions';
import createRootReducer from 'app/store/createRootReducer';
import loggerMiddleware from 'app/store/middleware/loggerMiddleware';
import createMessageMiddleware from 'app/store/middleware/messageMiddleware';
import promiseMiddleware from 'app/store/middleware/promiseMiddleware';
import createSentryMiddleware from 'app/store/middleware/sentryMiddleware';
import type { GetCookie } from 'app/types';
import type { History } from 'history';

export const history: History = __CLIENT__
  ? createBrowserHistory()
  : createMemoryHistory();

const createStore = (
  initialState = {},
  {
    Sentry,
    getCookie,
  }: {
    Sentry?: any;
    getCookie?: GetCookie;
  } = {}
) => {
  const store = configureStore({
    preloadedState: initialState,
    reducer: createRootReducer(history),
    middleware: (getDefaultMiddleware) =>
      getDefaultMiddleware({
        thunk: {
          extraArgument: {
            getCookie,
          },
        },
        serializableCheck: {
          ignoreActions: true,
        },
      })
        .prepend(promiseMiddleware())
        .concat(
          [
            routerMiddleware(history),
            createMessageMiddleware(
              (message) =>
                addToast({
                  message,
                }),
              Sentry
            ),
            Sentry && createSentryMiddleware(Sentry),
            __CLIENT__ &&
{'fraction_non_alphanumeric': 0.10209102091020911, 'fraction_numerical': 0.0, 'mean_word_length': 2.739080459770115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6403383', 'n_tokens_mistral': 843, 'n_tokens_neox': 866, 'n_words': 181}