<commit_before>import React from 'react';
import { connect } from 'react-redux';
import { recordingListenerAdd, recordingListenerRemove } from '../actions';

class VolumeMeter extends React.Component {
  constructor(props) {
    super(props);

    this.audioInputListener = this.audioInputListener.bind(this);
    this.setElement = this.setElement.bind(this);
  }

  componentDidMount() {
    this.props.dispatch(recordingListenerAdd(this.audioInputListener));
  }

  componentWillUnmount() {
    this.props.dispatch(recordingListenerRemove(this.audioInputListener));
  }

  shouldComponentUpdate() {
    return false;
  }

  audioInputListener(maxSample) {
    this.element.style.transform = `scale3d(${maxSample}, 1, 1)`;
  }

  setElement(element) {
    this.element = element;
  }

  render() {
    return (
      <div className="w4 h1 relative">
        <div className="absolute absolute--fill bg-black" />
        <div ref={this.setElement} className="absolute absolute--fill bg-white transform-origin-left" />
      </div>
    );
  }
}

export default connect()(VolumeMeter);<commit_msg>bind action creators in VolumeMeter<commit_after>import React from 'react';
import { connect } from 'react-redux';
import { recordingListenerAdd, recordingListenerRemove } from '../actions';

class VolumeMeter extends React.Component {
  constructor(props) {
    super(props);

    this.audioInputListener = this.audioInputListener.bind(this);
    this.setElement = this.setElement.bind(this);
  }

  componentDidMount() {
    this.props.recordingListenerAdd(this.audioInputListener);
  }

  componentWillUnmount() {
    this.props.recordingListenerRemove(this.audioInputListener);
  }

  shouldComponentUpdate() {
    return false;
  }

  audioInputListener(maxSample) {
    this.element.style.transform = `scale3d(${maxSample}, 1, 1)`;
  }

  setElement(element) {
    this.element = element;
  }

  render() {
    return (
      <div className="w4 h1 relative">
        <div className="absolute absolute--fill bg-black" />
        <div ref={this.setElement} className="absolute absolute--fill bg-white transform-origin-left" />
      </div>
    );
  }
}

export default connect(null, {
  recordingListenerAdd,
  recordingListenerRemove
})(VolumeMeter);
{'fraction_non_alphanumeric': 0.12716763005780346, 'fraction_numerical': 0.004446420631391729, 'mean_word_length': 3.9019607843137254, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '900629', 'n_tokens_mistral': 678, 'n_tokens_neox': 659, 'n_words': 122}