1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-27 23:06:29 -04:00
This commit is contained in:
Mark McDowall
2018-01-12 18:01:27 -08:00
committed by Taloth Saldono
parent 99feff549d
commit 5894b4fd95
1183 changed files with 91622 additions and 4978 deletions
@@ -0,0 +1,51 @@
import { createAction } from 'redux-actions';
import { createThunk, handleThunks } from 'Store/thunks';
import createFetchHandler from './Creators/createFetchHandler';
import createHandleActions from './Creators/createHandleActions';
//
// Variables
export const section = 'organizePreview';
//
// State
export const defaultState = {
isFetching: false,
isPopulated: false,
error: null,
items: []
};
//
// Actions Types
export const FETCH_ORGANIZE_PREVIEW = 'organizePreview/fetchOrganizePreview';
export const CLEAR_ORGANIZE_PREVIEW = 'organizePreview/clearOrganizePreview';
//
// Action Creators
export const fetchOrganizePreview = createThunk(FETCH_ORGANIZE_PREVIEW);
export const clearOrganizePreview = createAction(CLEAR_ORGANIZE_PREVIEW);
//
// Action Handlers
export const actionHandlers = handleThunks({
[FETCH_ORGANIZE_PREVIEW]: createFetchHandler('organizePreview', '/rename')
});
//
// Reducers
export const reducers = createHandleActions({
[CLEAR_ORGANIZE_PREVIEW]: (state) => {
return Object.assign({}, state, defaultState);
}
}, defaultState, section);