<commit_before># Component Documentation

Creates a React component. `fission.component` is different from `React.createClass` in a few ways - this will document the differences, for any other behavior you should consult the React documentation.

## fission.component(config)

```js
var fission = require('fission');
var DOM = fission.DOM;

var Timer = fission.component({
  init: function(){
    return {
      elapsed: 0
    };
  },
  tick: function(){
    this.updateState({
      elapsed: function(curr) {
        return ++curr;
      }
    });
  },
  mounted: function(){
    this.interval = setInterval(this.tick, 1000);
  },
  unmounting: function(){
    clearInterval(this.interval);
  },
  render: function(){
    var elapsedTxt = 'Seconds Elapsed: ' + this.state.elapsed;
    return DOM.div({
      className: 'timer-component'
    }, elapsedTxt);
  }
});<commit_msg>rearrange functions because @stevelacy is right<commit_after># Component Documentation

Creates a React component. `fission.component` is different from `React.createClass` in a few ways - this will document the differences, for any other behavior you should consult the React documentation.

## fission.component(config)

```js
var fission = require('fission');
var DOM = fission.DOM;

var Timer = fission.component({
  init: function(){
    return {
      elapsed: 0
    };
  },
  mounted: function(){
    this.interval = setInterval(this.tick, 1000);
  },
  unmounting: function(){
    clearInterval(this.interval);
  },

  tick: function(){
    this.updateState({
      elapsed: function(curr) {
        return ++curr;
      }
    });
  },
  render: function(){
    var elapsedTxt = 'Seconds Elapsed: ' + this.state.elapsed;
    return DOM.div({
      className: 'timer-component'
    }, elapsedTxt);
  }
});
{'fraction_non_alphanumeric': 0.1291224147568474, 'fraction_numerical': 0.005589714924538848, 'mean_word_length': 3.3552311435523112, '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': '1343963', 'n_tokens_mistral': 548, 'n_tokens_neox': 522, 'n_words': 153}