summaryrefslogtreecommitdiff
path: root/frontend/src/redux/errors.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/redux/errors.js')
-rw-r--r--frontend/src/redux/errors.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/frontend/src/redux/errors.js b/frontend/src/redux/errors.js
index eb807fdc..ec1e30b6 100644
--- a/frontend/src/redux/errors.js
+++ b/frontend/src/redux/errors.js
@@ -1,29 +1,26 @@
-import Immutable from "seamless-immutable";
+import Immutable from 'seamless-immutable';
export const types = {
- ERROR_RECEIVED_ON_WS: "ERROR/RECEIVED_ON_WS"
+ ERROR_RECEIVED_ON_WS: 'ERROR/RECEIVED_ON_WS',
};
export const actions = {
errorReceived: error => ({
type: types.ERROR_RECEIVED_ON_WS,
- error
- })
+ error,
+ }),
};
const initialState = Immutable.from({
nextId: 0,
- history: []
+ history: [],
});
export default (state = initialState, action) => {
switch (action.type) {
case types.ERROR_RECEIVED_ON_WS:
- let error = Object.assign(
- { id: state.nextId, timestamp: new Date() },
- action.error
- );
- let newState = state.set("nextId", state.nextId + 1);
+ let error = Object.assign({ id: state.nextId, timestamp: new Date() }, action.error);
+ let newState = state.set('nextId', state.nextId + 1);
newState = addErrorToHistory(newState, error);
return newState;
default:
@@ -32,7 +29,7 @@ export default (state = initialState, action) => {
};
function addErrorToHistory(state, error) {
- return addToArray(state, "history", error);
+ return addToArray(state, 'history', error);
}
function addToArray(state, arrayKey, element) {
bgstack15