28d7947910
This reverts commit f1bc7293ce
.
19 lines
441 B
JavaScript
19 lines
441 B
JavaScript
import * as ActionTypes from '../../../constants';
|
|
|
|
const consoleMax = 500;
|
|
const initialState = [];
|
|
|
|
const console = (state = initialState, action) => {
|
|
let messages;
|
|
switch (action.type) {
|
|
case ActionTypes.CONSOLE_EVENT:
|
|
messages = [...action.event];
|
|
return state.concat(messages).slice(-consoleMax);
|
|
case ActionTypes.CLEAR_CONSOLE:
|
|
return [];
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default console;
|