/*
 * boilerplate-redux-react
 *
 * Copyright(c) 2015 André König <andre.koenig@posteo.de>
 * MIT Licensed
 *
 */

/**
 * @author André König <andre.koenig@posteo.de>
 *
 */

import {handleActions} from 'redux-actions';

import Actions from '../actions';

const {RANDOMIZE} = Actions.greeting;

const GREETINS = [
    'Servus',
    'Hello',
    'Hallo',
    'Guten Tag'
];

function getRandomGreeting () {
    return GREETINS[Math.floor(Math.random() * 1000) % GREETINS.length];
}

function createState () {
    return getRandomGreeting();
}

export default handleActions({
    [RANDOMIZE]: (state, action) => {
        return getRandomGreeting()
    }
}, createState());

@@ -362,16 +362,70 @@
 ten Tag'
+,%0A    'Hey',%0A    'S%5C'up?',%0A    'Moin',%0A    'Moin Moin'
 %0A%5D;%0A%0Afun

Add some more greetings