<commit_before>var React = require('react');
var ReactDOM = require('react-dom');

var StoryInput = require('./StoryInput.js');
var GoButton = require('./GoButton.js');

var io = require('socket.io-client');
var socket = io.connect();

module.exports = React.createClass({

  getInitialState: function() {
    return {secondsElapsed: 600};
  },

  componentDidMount: function() {
    this.interval = setInterval(this.tick, 1000);
  },

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

  startTimer: function() {
  	if (!this.interval) {
      this.interval = setInterval(this.update, this.props.options.delay); // 100 is delay
    }
  },

  tick: function() {
    this.setState({secondsElapsed: this.state.secondsElapsed - 1});
  },

  pauseTimer: function() {
  	 if (this.interval) {
      clearInterval(this.interval);
      this.interval = null;
    }

  },

  endTimer: function() {

  },

  render: function() {
  	return (
      <div className='gameTimer'>
      Seconds Elapsed: {this.state.secondsElapsed}
      </div>
    );
  }
});
<commit_msg>Basic game timer component completed<commit_after>var React = require('react');
var ReactDOM = require('react-dom');

module.exports = React.createClass({
  
  getInitialState: function() {
    return {secondsElapsed: 600};
  },

  componentDidMount: function() {
    this.interval = setInterval(this.tick, 1000);
  },

  componentWillUnmount: function() {
    clearInterval(this.interval);
  },
  //sets interval to one second again
  startTimer: function() {
  	if (!this.interval) {
      this.interval = setInterval(this.tick, 1000);
    }
  },
  //normal tick of one second
  tick: function() {
    if (this.state.secondsElapsed > 0){
      this.setState({secondsElapsed: this.state.secondsElapsed - 1});
    }
  },
  //sets this interval to nothing, pausing timer
  pauseTimer: function() {
  	 if (this.interval) {
      clearInterval(this.interval);
      this.interval = null;
    }
  },

  render: function() {
  	return (
      <div className='gameTimer'>
      Seconds Elapsed: {this.state.secondsElapsed}
      </div>
    );
  }
});

{'fraction_non_alphanumeric': 0.14936589948332551, 'fraction_numerical': 0.011272898074213245, 'mean_word_length': 3.176470588235294, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '912706', 'n_tokens_mistral': 696, 'n_tokens_neox': 657, 'n_words': 140}