<commit_before>var Dispatcher = require("./dispatcher");

var Flux = function(stores, actions) {
  var dispatcher = new Dispatcher(stores),
      dispatchBinder = {
        dispatch: function(type, payload) {
          dispatcher.dispatch({type: type, payload: payload});
        }
      };

  this.dispatcher = dispatcher;
  this.actions = {};

  for (var key in actions) {
    if (actions.hasOwnProperty(key)) {
      this.actions[key] = actions[key].bind(dispatchBinder);
    }
  }

  for (key in stores) {
    if (stores.hasOwnProperty(key)) {
      stores[key].flux = this;
    }
  }
};

Flux.prototype.store = function(name) {
  return this.dispatcher.stores[name];
};

module.exports = Flux;
<commit_msg>Maintain references to stores on Flux object<commit_after>var Dispatcher = require("./dispatcher");

var Flux = function(stores, actions) {
  var dispatcher = new Dispatcher(stores),
      dispatchBinder = {
        dispatch: function(type, payload) {
          dispatcher.dispatch({type: type, payload: payload});
        }
      };

  this.dispatcher = dispatcher;
  this.actions = {};
  this.stores = stores;

  for (var key in actions) {
    if (actions.hasOwnProperty(key)) {
      this.actions[key] = actions[key].bind(dispatchBinder);
    }
  }

  for (key in stores) {
    if (stores.hasOwnProperty(key)) {
      stores[key].flux = this;
    }
  }
};

Flux.prototype.store = function(name) {
  return this.stores[name];
};

module.exports = Flux;

{'fraction_non_alphanumeric': 0.14051841746248295, 'fraction_numerical': 0.0, 'mean_word_length': 3.052486187845304, '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': '7264867', 'n_tokens_mistral': 482, 'n_tokens_neox': 475, 'n_words': 98}