<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import compose from 'recompose/compose';
import mapProps from 'recompose/mapProps';
import getContext from 'recompose/getContext';
import { combineHandlers } from '../utils/compositionUtils';

const EnhancedHeadingCell = OriginalComponent => compose(
  getContext({
    events: PropTypes.object,
  }),
  mapProps(({ events: { onSort }, ...props }) => ({
    ...props,
    onClick: combineHandlers([() => onSort && onSort({ id: props.columnId }), props.onClick]),
  }))
)(props => <OriginalComponent {...props} />);

export default EnhancedHeadingCell;<commit_msg>Send full sortProperty to events.onSort<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import compose from 'recompose/compose';
import mapProps from 'recompose/mapProps';
import getContext from 'recompose/getContext';
import { combineHandlers } from '../utils/compositionUtils';

const EnhancedHeadingCell = OriginalComponent => compose(
  getContext({
    events: PropTypes.object,
  }),
  mapProps(({ events: { onSort }, ...props }) => ({
    ...props,
    onClick: combineHandlers([
      () => onSort && onSort(props.sortProperty || { id: props.columnId }),
      props.onClick,
    ]),
  }))
)(props => <OriginalComponent {...props} />);

export default EnhancedHeadingCell;
{'fraction_non_alphanumeric': 0.15344699777613047, 'fraction_numerical': 0.0, 'mean_word_length': 4.601659751037344, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '813083', 'n_tokens_mistral': 395, 'n_tokens_neox': 390, 'n_words': 101}