<commit_before>import React, { PropTypes } from 'react';
import { connect } from 'react-redux';

import LoadingSpinner from './LoadingSpinner';
import { AsyncReferencePropType, STATUS, resolveReference } from '../AsyncStorage';

export const RENDER_STRATEGY = Object.freeze({
  ALL: Symbol('all')
  // TODO: ANY
});

class AsyncContentListComponent extends React.Component {
  static propTypes = {
    references: PropTypes.arrayOf(AsyncReferencePropType).isRequired,
    render: PropTypes.func.isRequired,
    renderStrategy: PropTypes.oneOf([RENDER_STRATEGY.ALL]),
    // Literally anything
    resolvedReferences: PropTypes.arrayOf(PropTypes.any).isRequired
  };

  renderLoading() {
    return (<LoadingSpinner/>);
  }

  shouldRender() {
    const { resolvedReferences } = this.props;
    // TODO: Implement Any render strategy
    return resolvedReferences.every(reference => {
      return !(reference === STATUS.EMPTY_REFERENCE) && !(reference === STATUS.LOADING);
    })
  }

  render() {
    const {
      resolvedReferences,
      render,
    } = this.props;

    if (this.shouldRender()) {
      return render(resolvedReferences);
    } else {
      return this.renderLoading();
    }
  }
}

function mapStateToProps(state, ownProps) {
  const asyncContent = state.get('async'),
    { references } = ownProps;

  return {
    resolvedReferences: references.map(reference => resolveReference(asyncContent, reference));
  }
}

export default connect(mapStateToProps)(AsyncContentListComponent);<commit_msg>Fixed AsyncContentListComponent<commit_after>import React, { PropTypes } from 'react';
import { connect } from 'react-redux';

import LoadingSpinner from './LoadingSpinner';
import { AsyncReferencePropType, STATUS, resolveReference } from '../AsyncStorage';

export const RENDER_STRATEGY = Object.freeze({
  ALL: Symbol('all')
  // TODO: ANY
});

class AsyncContentListComponent extends React.Component {
  static propTypes = {
    references: PropTypes.arrayOf(AsyncReferencePropType).isRequired,
    render: PropTypes.func.isRequired,
    renderStrategy: PropTypes.oneOf([RENDER_STRATEGY.ALL]),
    // Literally anything
    resolvedReferences: PropTypes.arrayOf(PropTypes.any).isRequired
  };

  renderLoading() {
    return (<LoadingSpinner/>);
  }

  shouldRender() {
    const { resolvedReferences } = this.props;
    // TODO: Implement Any render strategy
    return resolvedReferences.every(reference => {
      return !(reference === STATUS.EMPTY_REFERENCE) && !(reference === STATUS.LOADING);
    })
  }

  render() {
    const {
      resolvedReferences,
      render,
    } = this.props;

    if (this.shouldRender()) {
      return render(resolvedReferences);
    } else {
      return this.renderLoading();
    }
  }
}

function mapStateToProps(state, ownProps) {
  const asyncContent = state.get('async'),
    { references } = ownProps;

  return {
    resolvedReferences: references.map(reference => resolveReference(asyncContent, reference))
  }
}

export default connect(mapStateToProps)(AsyncContentListComponent);
{'fraction_non_alphanumeric': 0.12036733355198426, 'fraction_numerical': 0.0, 'mean_word_length': 4.016447368421052, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7485827', 'n_tokens_mistral': 871, 'n_tokens_neox': 860, 'n_words': 180}