<commit_before>import React from 'react';

import { createStore } from 'redux'

const initialAirplanesState = {
  airplanes: [],
}

const airplaneReducer = (state = initialAirplanesState, action) => {
  let newState = Object.assign({}, state);
  switch (action.type) {
    case 'ADD_AIRPLANE':
      newState.airplanes = state.airplanes.concat(action.params.newPlane)
      return newState;
    default:
      return state;
  }
};

let store = createStore(airplaneReducer)

store.subscribe(() => {
  console.log(store.getState())
})

store.dispatch({
  type: 'ADD_AIRPLANE', 
  params: {
    newPlane: {
      name: 'tom'
    }
  }
})

store.dispatch({
  type: 'ADD_AIRPLANE', 
  params: {
    newPlane: {
      name: 'jerry'
    }
  }
})



/////////////////////////////////


export default class App extends React.Component {
  constructor(props) {
    super(props)
  }

  render() {
    return (
      <div style={{textAlign: 'center'}}>
        <h1>✈️</h1>
      </div>
    );
  }
}<commit_msg>finially, a loop that adds airplanes<commit_after>import React from 'react';

import { createStore } from 'redux'

const initialAirplanesState = {
  airplanes: [],
}

const airplaneReducer = (state = initialAirplanesState, action) => {
  let newState = Object.assign({}, state);
  switch (action.type) {
    case 'ADD_AIRPLANE':
      newState.airplanes = state.airplanes.concat(action.params.newPlane)
      return newState;
    default:
      return state;
  }
};

let store = createStore(airplaneReducer)

store.subscribe(() => {
  console.log(store.getState())
})

function mainLoop() {

  store.dispatch({
    type: 'ADD_AIRPLANE', 
    params: {
      newPlane: {
        name: 'jerry'
      }
    }
  })

}

mainLoop()

window.setInterval(mainLoop, 5 * 1000)



/////////////////////////////////


export default class App extends React.Component {
  constructor(props) {
    super(props)
  }

  render() {
    return (
      <div style={{textAlign: 'center'}}>
        <h1>✈️</h1>
      </div>
    );
  }
}
{'fraction_non_alphanumeric': 0.17287630402384502, 'fraction_numerical': 0.004470938897168405, 'mean_word_length': 2.577264653641208, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '5845746', 'n_tokens_mistral': 719, 'n_tokens_neox': 684, 'n_words': 134}