<commit_before>import {createStore, applyMiddleware} from 'redux';
import threadDispatcher from '../common/thread-middleware';
import handleMessages from '../common/message-handler';
import messages from './messages';
import reducers from './reducers';
import createLogger from 'redux-logger';
import thunk from 'redux-thunk';

const store = createStore(
  // Reducers:
  reducers,
  // Initial State:
  {},
  // Enhancers:
  applyMiddleware(
    thunk,
    threadDispatcher(self, 'toContent'),
    process.env.NODE_ENV === 'development'
      ? createLogger({ titleFormatter: action => `worker action ${action.type}` })
      : null
  ));

handleMessages(self, store, messages);<commit_msg>Don't pass null middleware in the worker.<commit_after>import {createStore, applyMiddleware} from 'redux';
import threadDispatcher from '../common/thread-middleware';
import handleMessages from '../common/message-handler';
import messages from './messages';
import reducers from './reducers';
import createLogger from 'redux-logger';
import thunk from 'redux-thunk';

const store = createStore(
  // Reducers:
  reducers,
  // Initial State:
  {},
  // Enhancers:
  applyMiddleware(...[
    thunk,
    threadDispatcher(self, 'toContent'),
    process.env.NODE_ENV === 'development'
      ? createLogger({ titleFormatter: action => `worker action ${action.type}` })
      : null
  ].filter(fn => fn)));

handleMessages(self, store, messages);
{'fraction_non_alphanumeric': 0.1424581005586592, 'fraction_numerical': 0.0, 'mean_word_length': 4.307407407407408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '4583856', 'n_tokens_mistral': 412, 'n_tokens_neox': 406, 'n_words': 113}