<commit_before>import React, {Component} from 'react'
import collectFps from 'collect-fps'

const noop = () => {}

export default ({
  threshold = 30,
  fpsCollector = collectFps
}) => (Target) => {
  let endFPSCollection = noop

  const handleStartFPSCollection = (component) => {
    if (endFPSCollection !== noop) { endFPSCollection() }

    endFPSCollection = fpsCollector()
  }

  class MonitorAnimationSpeed extends Component {
    constructor () {
      super()

      this.state = {fps: 60}
    }

    render () {
      return <Target
        {...this.props}
        onStartFPSCollection={handleStartFPSCollection}
        onEndFPSCollection={() => {
          if (endFPSCollection !== noop) {
            this.setState({fps: endFPSCollection()})
            endFPSCollection = noop
          }<commit_msg>Use threshold for the initial fps state<commit_after>import React, {Component} from 'react'
import collectFps from 'collect-fps'

const noop = () => {}

export default ({
  threshold = 30,
  fpsCollector = collectFps
}) => (Target) => {
  let endFPSCollection = noop

  const handleStartFPSCollection = (component) => {
    if (endFPSCollection !== noop) { endFPSCollection() }

    endFPSCollection = fpsCollector()
  }

  class MonitorAnimationSpeed extends Component {
    constructor () {
      super()

      this.state = {fps: threshold}
    }

    render () {
      return <Target
        {...this.props}
        onStartFPSCollection={handleStartFPSCollection}
        onEndFPSCollection={() => {
          if (endFPSCollection !== noop) {
            this.setState({fps: endFPSCollection()})
            endFPSCollection = noop
          }
{'fraction_non_alphanumeric': 0.12040939193257075, 'fraction_numerical': 0.003612281757977122, 'mean_word_length': 2.785876993166287, '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': '2825177', 'n_tokens_mistral': 506, 'n_tokens_neox': 492, 'n_words': 110}