You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readarr/frontend/src/Store/Reducers/organizePreviewReducers.js

27 lines
689 B

import { handleActions } from 'redux-actions';
import * as types from 'Store/Actions/actionTypes';
import createSetReducer from './Creators/createSetReducer';
import createUpdateReducer from './Creators/createUpdateReducer';
export const defaultState = {
isFetching: false,
isPopulated: false,
error: null,
items: []
};
const reducerSection = 'organizePreview';
const organizePreviewReducers = handleActions({
[types.SET]: createSetReducer(reducerSection),
[types.UPDATE]: createUpdateReducer(reducerSection),
[types.CLEAR_ORGANIZE_PREVIEW]: (state) => {
return Object.assign({}, state, defaultState);
}
}, defaultState);
export default organizePreviewReducers;