<commit_before>import {createStore, compose, applyMiddleware, combineReducers} from "redux";
import { composeWithDevTools } from 'redux-devtools-extension';
import thunk from "redux-thunk";

import isPlainObject from "./isPlainObject";

export const defaultMiddleware = [thunk];

export function configureStore(options = {}) {
    const {
        reducer,
        middleware = defaultMiddleware,
        devTools = true,
        preloadedState,
        enhancers = [],
    } = options;

    let rootReducer;

    if(typeof reducer === "function") {
        rootReducer = reducer;
    }
    else if(isPlainObject(reducer)) {
        rootReducer = combineReducers(reducer);
    }
    else {
        throw new Error("Reducer argument must be a function or an object of functions that can be passed to combineReducers");
    }


    const middlewareEnhancer = applyMiddleware(...middleware);
<commit_msg>Replace defaultMiddleware<commit_after>import {createStore, compose, applyMiddleware, combineReducers} from "redux";
import { composeWithDevTools } from 'redux-devtools-extension';
import thunk from "redux-thunk";

import isPlainObject from "./isPlainObject";

export function getDefaultMiddleware() {
    return [thunk];
}

export function configureStore(options = {}) {
    const {
        reducer,
        middleware = getDefaultMiddleware(),
        devTools = true,
        preloadedState,
        enhancers = [],
    } = options;

    let rootReducer;

    if(typeof reducer === "function") {
        rootReducer = reducer;
    }
    else if(isPlainObject(reducer)) {
        rootReducer = combineReducers(reducer);
    }
    else {
        throw new Error("Reducer argument must be a function or an object of functions that can be passed to combineReducers");
    }


    const middlewareEnhancer = applyMiddleware(...middleware);

{'fraction_non_alphanumeric': 0.09738846572361262, 'fraction_numerical': 0.0, 'mean_word_length': 3.2767441860465114, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2720001', 'n_tokens_mistral': 531, 'n_tokens_neox': 523, 'n_words': 140}