<commit_before>import { combineReducers } from 'redux'
import { RECEIVE_STOP_DATA } from '../actions'

const cardsReducer = () => {
  return {cards: [{name: 'Fruängen', stopId: '9260', updating: false, error: false},{name: 'Slussen', stopId: '9192', updating: false, error: false}]}
}

const stopsReducer = (state, action) => {
  switch (action.type) {
  case RECEIVE_STOP_DATA:
    var s = Object.assign({}, state)
    s.stops[action.stop] = action.data.departures
    return s
    
  default:
    return state == undefined ? {stops: {}} : state
  }
}

const departuresApp = combineReducers({
  cardsReducer,
  stopsReducer
})

export default departuresApp<commit_msg>Add direction information to cards<commit_after>import { combineReducers } from 'redux'
import { RECEIVE_STOP_DATA } from '../actions'

const cardsReducer = () => {
  return {cards: [
    {
      name: 'Fruängen',
      stopId: '9260',
      updating: false,
      error: false,
      lines: [{
        line: '14',
        direction: 1
      }]
    },
    {
      name: 'Slussen',
      stopId: '9192',
      updating: false,
      error: false,
      lines: [{
        line: '14',
        direction: 2
      }]
    }]}
}

/*
 * Filter new stop information and add them to the new state
 */
const stopsReducer = (state, action) => {
  switch (action.type) {
  case RECEIVE_STOP_DATA:
    var newState = Object.assign({}, state)
    newState.stops[action.stop] = action.data.departures
    return newState
    
  default:
    return state == undefined ? {stops: {}} : state
  }
}

const departuresApp = combineReducers({
  cardsReducer,
  stopsReducer
})

export default departuresApp
{'fraction_non_alphanumeric': 0.1337772397094431, 'fraction_numerical': 0.013317191283292978, 'mean_word_length': 2.964028776978417, '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': '197929', 'n_tokens_mistral': 567, 'n_tokens_neox': 548, 'n_words': 139}