<commit_before>'use strict'

import React, { Component } from 'react'
import ReactDom from 'react-dom'
import 'whatwg-fetch'
import matchPath from './matchPath'


/**
 * @class: AsyncRouteManager
 * @description: The idea behind this component is to facilitate the
 * data fetch and preloading for the react-router Route components in the easiest way.
 */
class AsyncRouteManager extends Component {

  static defaultProps = {
    transitionTiemOut: 600
  }

  static propTypes = {
    transitionTiemOut: React.PropTypes.number
  }

  constructor (...args) {
    super(...args)

    this.initialFetch = true
    this.fetchingData = false
    this.prevChildren = null
    this.nextChildren = null
    this.dom = null
    this.transitioning = false
    this.data = {}
  }


  componentWillMount () {
    this.nextChildren = this.props.children
    this.checkChildrenConfigProps()
  }


  componentWillReceiveProps (nextProps) {
    console.log('componentWillReceiveProps')
    // If the new view is the actual view, we don't render
    if (this.props.children.type.name === nextProps.children.type.name)
      return false

    this.prevChildren = this.nextChildren
    this.nextChildren = nextProps.children

    // If the previus view dont like data caching
    if (this.prevChildren
        && this.prevChildren.props.route.config
        && this.prevChildren.props.route.config.datacaching === false) {
      this.prevChildren.props.route.config.hasdata = false<commit_msg>cleaning<commit_after>'use strict'

import React, { Component } from 'react'
import ReactDom from 'react-dom'
import 'whatwg-fetch'
import matchPath from './matchPath'


/**
 * @class: AsyncRouteManager
 * @description: The idea behind this component is to facilitate the
 * data fetch and preloading for the react-router Route components in the easiest way.
 */
class AsyncRouteManager extends Component {

  static defaultProps = {
    transitionTiemOut: 600
  }

  static propTypes = {
    transitionTiemOut: React.PropTypes.number
  }

  constructor (...args) {
    super(...args)

    this.initialFetch = true
    this.fetchingData = false
    this.prevChildren = null
    this.nextChildren = null
    this.dom = null
    this.transitioning = false
    this.data = {}
  }


  componentWillMount () {
    this.nextChildren = this.props.children
    this.checkChildrenConfigProps()
  }


  componentWillReceiveProps (nextProps) {
    // If the new view is the actual view, we don't render
    if (this.props.children.type.name === nextProps.children.type.name)
      return false

    this.prevChildren = this.nextChildren
    this.nextChildren = nextProps.children

    // If the previus view dont like data caching
    if (this.prevChildren
        && this.prevChildren.props.route.config
        && this.prevChildren.props.route.config.datacaching === false) {
      this.prevChildren.props.route.config.hasdata = false
{'fraction_non_alphanumeric': 0.09620689655172414, 'fraction_numerical': 0.0020689655172413794, 'mean_word_length': 3.2104499274310596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2428086', 'n_tokens_mistral': 842, 'n_tokens_neox': 804, 'n_words': 222}