2017-01-10 00:09:23 +01:00
|
|
|
import * as ActionTypes from '../../../constants';
|
|
|
|
|
|
|
|
const consoleMax = 200;
|
|
|
|
const initialState = [];
|
|
|
|
|
|
|
|
const console = (state = initialState, action) => {
|
|
|
|
switch (action.type) {
|
|
|
|
case ActionTypes.CONSOLE_EVENT:
|
2017-01-11 20:13:49 +01:00
|
|
|
return state.concat(action.event).slice(-consoleMax);
|
2017-01-10 00:09:23 +01:00
|
|
|
case ActionTypes.CLEAR_CONSOLE:
|
|
|
|
return [];
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default console;
|