<commit_before>'use strict';

import React from 'react';
import { RouteHandler } from 'react-router';

import 'normalize.css';
import 'styles/main.css';


const ClocketteApp = React.createClass({

  getInitialState() {
    this.interval = null;

    return {
      ts: Date.now()
    };
  },

  componentDidMount() {
    this.interval = setInterval(() => {
      this.setState({
        ts: Date.now()
      });
    }, 1000 * 30);
  },

  componentWillUnmount() {
    clearInterval(this.interval);
  },

  render() {
    return (
      <RouteHandler ts={this.state.ts}/>
    );
  }

});

export default ClocketteApp;<commit_msg>Improve App refresh frequency to match user's device clock<commit_after>'use strict';

import React from 'react';
import { RouteHandler } from 'react-router';

import 'normalize.css';
import 'styles/main.css';


const ClocketteApp = React.createClass({

  getInitialState() {
    this.interval = null;

    return {
      ts: Date.now()
    };
  },

  componentDidMount() {
    let adjustInterval = setInterval(() => {
      const now = new Date();
      if (now.getSeconds() === 0) {
        clearInterval(adjustInterval);
        this.updateTS();
        this.interval = setInterval(this.updateTS, 1000 * 60);
      }
    }, 1000);
  },

  componentWillUnmount() {
    clearInterval(this.interval);
  },

  updateTS() {
    this.setState({ ts: Date.now() });
  },

  render() {
    return (
      <RouteHandler ts={this.state.ts}/>
    );
  }

});

export default ClocketteApp;
{'fraction_non_alphanumeric': 0.15328467153284672, 'fraction_numerical': 0.0112806901128069, 'mean_word_length': 2.7889447236180906, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6696125', 'n_tokens_mistral': 505, 'n_tokens_neox': 473, 'n_words': 101}