<commit_before>// third party imports
import throttle from 'lodash/function/throttle'
// local imports
import calculateResponsiveState from '../actions/creators/calculateResponsiveState'


/**
 * Dispatches an action to calculate the responsive state, then kicks of the
 * (throttled) window resize event listener (which will dispatch further such
 * actions).
 * @arg {object} store - The redux store.  Really you only need to pass `{dispatch}`.
 * @arg {number} [throttleTime=100] - Throttle time (in miliseconds) for the
 * window resize event handler.
 */
export default (store, throttleTime = 100) => {
    // throttled event handler for window resize
    const throttledHandler = throttle(
        // just dispatch action to calculate responsive state
        () => store.dispatch(calculateResponsiveState(
            // annoying existential check for window
            typeof window === 'undefined' ? {} : window
        )),
        throttleTime
    )
    // initialize the responsive state
    throttledHandler()
    // if there is a `window`
    if (typeof window !== 'undefined') {
        // add the resize event listener
        window.addEventListener('resize', () => throttledHandler())
    }
    // return the store so that the call is transparent
    return store
}
<commit_msg>removed default value for throttle time from addResponsiveHandlers (since it is covered by store enhancer)<commit_after>// third party imports
import throttle from 'lodash/function/throttle'
// local imports
import calculateResponsiveState from '../actions/creators/calculateResponsiveState'


/**
 * Dispatches an action to calculate the responsive state, then kicks of the
 * (throttled) window resize event listener (which will dispatch further such
 * actions).
 * @arg {object} store - The redux store.  Really you only need to pass `{dispatch}`.
 * @arg {number} throttleTime - Throttle time (in miliseconds) for the
 * window resize event handler.
 */
export default (store, throttleTime) => {
    // throttled event handler for window resize
    const throttledHandler = throttle(
        // just dispatch action to calculate responsive state
        () => store.dispatch(calculateResponsiveState(
            // annoying existential check for window
            typeof window === 'undefined' ? {} : window
        )),
        throttleTime
    )
    // initialize the responsive state
    throttledHandler()
    // if there is a `window`
    if (typeof window !== 'undefined') {
        // add the resize event listener
        window.addEventListener('resize', () => throttledHandler())
    }
    // return the store so that the call is transparent
    return store
}

{'fraction_non_alphanumeric': 0.0920314253647587, 'fraction_numerical': 0.002244668911335578, 'mean_word_length': 3.0949464012251147, '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': '2743512', 'n_tokens_mistral': 710, 'n_tokens_neox': 659, 'n_words': 267}