<commit_before>var Store = require('./es6_store')
var ActionTypes = window.CONSTANTS.ActionTypes;
var UserStore = require('./user_store');

var _dispatchToken = null,
    _client = null

class PusherStore extends Store {
  constructor() {
    super()

    _dispatchToken = Dispatcher.register((action) => {
      switch(action.type) {
        case ActionTypes.PUSHER_INITIALIZED:
          _client = action.client

          if (UserStore.get() && _client) {
            _client.
              subscribe('user.' + UserStore.getId()).
              bind_all((payload, data) => {
                Dispatcher.dispatch({
                  type: ActionTypes.PUSHER_USER_ACTION,
                  event: payload,
                  payload: data
                })
              });
          }

          this.emitChange()
          break;
      }
    })
  }

  getClient() {
    return _client
  }

  getDispatchToken() {
    return _dispatchToken
  }
}

module.exports = new PusherStore()<commit_msg>Fix failing test<commit_after>var Store = require('./es6_store')
var ActionTypes = window.CONSTANTS.ActionTypes;
var UserStore = require('./user_store');

var _dispatchToken = null,
    _client = null

class PusherStore extends Store {
  constructor() {
    super()

    _dispatchToken = Dispatcher.register((action) => {
      switch(action.type) {
        case ActionTypes.PUSHER_INITIALIZED:
          _client = action.client

          if (UserStore.getUser() && _client) {
            _client.
              subscribe('user.' + UserStore.getId()).
              bind_all((payload, data) => {
                Dispatcher.dispatch({
                  type: ActionTypes.PUSHER_USER_ACTION,
                  event: payload,
                  payload: data
                })
              });
          }

          this.emitChange()
          break;
      }
    })
  }

  getClient() {
    return _client
  }

  getDispatchToken() {
    return _dispatchToken
  }
}

module.exports = new PusherStore()
{'fraction_non_alphanumeric': 0.10916374561842764, 'fraction_numerical': 0.00100150225338007, 'mean_word_length': 1.8101265822784811, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2225990', 'n_tokens_mistral': 572, 'n_tokens_neox': 549, 'n_words': 107}