<commit_before>// # Store
//
// A Thundercats Store is an observable. It can update itself
// according to observables it listens to passed in through
// the `getOperations` method
import Rx from 'rx';
import uuid from 'node-uuid';
import invariant from 'invariant';
import warning from 'warning';
import debugFactory from 'debug';
import assign from 'object.assign';
import Actions from './Actions';
import { areObservable, isObservable, isPromise } from './utils';

const debug = debugFactory('thundercats:store');

// ## Create
//
// Takes a spec object and returns an Rx Observable Thundercats store
class Store extends Rx.Observable {

  constructor() {
    super(this._subscribe);

    this.__value = null;
    this._operationsSubscription = null;
    this._actions = new Map();
    this._observers = new Map();
    this._history = new Map();
    this.displayName = this.constructor.displayName || 'BaseStore';
  }

  registerAction(action) {
    invariant(
      typeof action === 'function' &&
      isObservable(action),
      '%s attempted to register non ThunderCats action %s',
      this.displayName,<commit_msg>Use prototype instead of 'this' before super exit<commit_after>// # Store
//
// A Thundercats Store is an observable. It can update itself
// according to observables it listens to passed in through
// the `getOperations` method
import Rx from 'rx';
import uuid from 'node-uuid';
import invariant from 'invariant';
import warning from 'warning';
import debugFactory from 'debug';
import assign from 'object.assign';
import Actions from './Actions';
import { areObservable, isObservable, isPromise } from './utils';

const debug = debugFactory('thundercats:store');

// ## Create
//
// Takes a spec object and returns an Rx Observable Thundercats store
class Store extends Rx.Observable {

  constructor() {
    super(Store.prototype._subscribe);

    this.__value = null;
    this._operationsSubscription = null;
    this._actions = new Map();
    this._observers = new Map();
    this._history = new Map();
    this.displayName = this.constructor.displayName || 'BaseStore';
  }

  registerAction(action) {
    invariant(
      typeof action === 'function' &&
      isObservable(action),
      '%s attempted to register non ThunderCats action %s',
      this.displayName,
{'fraction_non_alphanumeric': 0.11188506747932085, 'fraction_numerical': 0.0, 'mean_word_length': 3.7974947807933193, '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': '6132053', 'n_tokens_mistral': 632, 'n_tokens_neox': 609, 'n_words': 226}