<commit_before>/** @jsx React.DOM */

define([
  "React"
], function(React) {

  return React.createClass({
    displayName: "StackedViewComponent",
    getInitialState: function () {
      return {
        activeViewIndex: 0,
        viewStack: [0]
      };
    },
    setActiveViewIndex: function (index) {
      this.setState({activeViewIndex: index});
      this.state.viewStack.push(index);
    },
    popView: function() {
      this.state.viewStack.pop();<commit_msg>Review: using immutable helpers<commit_after>/** @jsx React.DOM */

define([
  "React"
], function(React) {

  return React.createClass({
    displayName: "StackedViewComponent",
    getInitialState: function () {
      return {
        activeViewIndex: 0,
        viewStack: [0]
      };
    },
    setActiveViewIndex: function (index) {
      this.setState(React.addons.update(this.state, {
        activeViewIndex: {$set: index},
        viewStack: {$push: [index]}
      }));
    },
    popView: function() {
      this.state.viewStack.pop();
{'fraction_non_alphanumeric': 0.1480392156862745, 'fraction_numerical': 0.00392156862745098, 'mean_word_length': 2.7536764705882355, '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': '395979', 'n_tokens_mistral': 319, 'n_tokens_neox': 322, 'n_words': 58}