<commit_before>import React from 'react';
import { connect } from 'react-redux';
import ConnectionCard from '../components/connection-card.jsx';

export const DeparturingNext = React.createClass({

  render() {
    return(
      <div className="pure-g">
        <div className="pure-u-1 pure-u-md-1-4">
          {this.props.connections.map(c => {
            return (
              <ConnectionCard connection={c} />
            );
          })}
        </div>
      </div>
    );
  }
});

function mapStateToProps(state) {
  return {
    connections: state.connections.get('departuringNext').toJS()
  };
}

export const DeparturingNextConnected = connect(mapStateToProps)(DeparturingNext);<commit_msg>feat(departuring-next): fetch connections departuring next on componentDidMount<commit_after>import React from 'react';
import { connect } from 'react-redux';
import * as actions from '../actions/connections-actions';

import ConnectionCard from '../components/connection-card.jsx';

export const DeparturingNext = React.createClass({

  propTypes: {
    fetchConnectionsDeparturingNext: React.PropTypes.func.isRequired,
    connections: React.PropTypes.array.isRequired
  },

  getDefaultProps() {
    return {
      fetchConnectionsDeparturingNext: () => {},
      connections: []
    };
  },

  componentDidMount() {
    this.props.fetchConnectionsDeparturingNext();
  },

  render() {

    const connectionCards = this.props.connections.map((conn, index) => {
      return (<ConnectionCard key={index} connection={conn} />);
    });

    return(
      <div className="pure-g">
        <div className="pure-u-1 pure-u-md-1-4">
          {connectionCards}
        </div>
      </div>
    );
  }
});

function mapStateToProps(state) {
  return {
    connections: state.connections.get('departuringNext').toJS()
  };
}

export const DeparturingNextConnected = connect(mapStateToProps, actions)(DeparturingNext);
{'fraction_non_alphanumeric': 0.1390486147412441, 'fraction_numerical': 0.0031364349189754314, 'mean_word_length': 3.2628062360801784, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 16, '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': '3719945', 'n_tokens_mistral': 581, 'n_tokens_neox': 562, 'n_words': 103}