<commit_before>import mutate from './mutate'

const game = () => {

  let state = {
    nowPlaying: 0,
    board: [],
    won: false
  }

  let subscribers = []
  const subscribe = (callback, actions = []) => {
    subscribers.push({
      callback,
      actions
    })
  }

  const dispatch = (action) => {
    state = mutate(action, state)
    notify(action, state)
  }

  const notify = (action, state) => {
    _.each(subscribers, subscriber => {
      if(!subscriber.actions.length || subscriber.actions.includes(action.type)){
        subscriber.callback(action, state)
      }
    })
    return true
  }

  return {
    dispatch,
    subscribe
  }
}

export default game
<commit_msg>removed quasi-middleware-listeners filter something<commit_after>import mutate from './mutate'

const game = () => {

  let state = {
    nowPlaying: 0,
    board: [],
    won: false
  }

  let subscribers = []
  const subscribe = (callback) => {
    subscribers.push({ callback })
  }

  const dispatch = (action) => {
    state = mutate(action, state)
    notify(action, state)
  }

  const notify = (action, state) => {
    _.each(subscribers, subscriber => {
      subscriber.callback(action, state)
    })
    return true
  }

  return {
    dispatch,
    subscribe
  }
}

export default game

{'fraction_non_alphanumeric': 0.13421256788207914, 'fraction_numerical': 0.0015515903801396431, 'mean_word_length': 2.5342465753424657, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '3549284', 'n_tokens_mistral': 427, 'n_tokens_neox': 402, 'n_words': 95}