<commit_before>/**
 * Created by carl.hand on 18/04/2017.
 */<commit_msg>created switch function for reducer with case for adding a player<commit_after>/**
 * Created by carl.hand on 18/04/2017.
 */
import * as PlayerActionTypes from '../actiontypes/player';

const initialState = [
    {
        name: "Carl",
        score: 0,
    },
    {
        name: "Lee",
        score: 0,
    },
];

export default function Player(state=initialState, action) {
    switch(action.type) {
        case PlayerActionTypes.ADD:
            return [
                ...state,
                {
                    name: action.name,
                    score: 0
                }
            ];
        default:
            return state;
    }
}
{'fraction_non_alphanumeric': 0.11491108071135431, 'fraction_numerical': 0.025991792065663474, 'mean_word_length': 1.4646464646464648, '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': '2604682', 'n_tokens_mistral': 225, 'n_tokens_neox': 202, 'n_words': 54}