<commit_before>import {Map, List, fromJS} from 'immutable';

function setState(state, newState) {
  return state.merge(newState);
}
function addMember(members = List()){
  const newmembers = members.push(Map({
    name: '',
    address: '',
    latlng: undefined,
    latlng_dirty: true,
    party: '',
    id: '',
  }))
  return newmembers
}

function removeMember(members = List(), index){
  if (0 === members.size){
    return members
  } else {
    return members.remove(index)
  }
}

function updateName(members, index, name) {
  return members.updateIn([index, 'name'], (name) => name)
}

function updateAddress(members, index, address) {
  return members.updateIn([index, 'address'], (name) =>  address)
}

function submit(members) {
  console.log("submitting "+members)
}
<commit_msg>submit must also return the state.<commit_after>import {Map, List, fromJS} from 'immutable';

function setState(state, newState) {
  return state.merge(newState);
}
function addMember(members = List()){
  const newmembers = members.push(Map({
    name: '',
    address: '',
    latlng: undefined,
    latlng_dirty: true,
    party: '',
    id: '',
  }))
  return newmembers
}

function removeMember(members = List(), index){
  if (0 === members.size){
    return members
  } else {
    return members.remove(index)
  }
}

function updateName(members, index, name) {
  return members.updateIn([index, 'name'], (name) => name)
}

function updateAddress(members, index, address) {
  return members.updateIn([index, 'address'], (name) =>  address)
}

function submit(members) {
  return members
}

{'fraction_non_alphanumeric': 0.15205047318611986, 'fraction_numerical': 0.0012618296529968455, 'mean_word_length': 4.183006535947713, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5988528', 'n_tokens_mistral': 506, 'n_tokens_neox': 504, 'n_words': 127}