Files
bigcapital/client/src/store/globalErrors/globalErrors.reducer.js
2020-05-26 17:51:00 +02:00

18 lines
327 B
JavaScript

import { createReducer } from '@reduxjs/toolkit';
import t from 'store/types';
const initialState = {
data: {},
};
export default createReducer(initialState, {
['GLOBAL_ERRORS_SET']: (state, action) => {
const { errors } = action.payload;
state.data = {
...state.data,
...errors,
};
},
});