All files / src/redux/Common Common.js

0% Statements 0/8
100% Branches 0/0
100% Functions 0/0
0% Lines 0/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                                                     
import { makeAsyncReducer, makeAsyncActionCreator, composeReducers } from 'redux-toolbelt';
import { makeAsyncSaga } from 'redux-toolbelt-saga';
import { saveCommonDataService, updateCommonDataService } from './service';
 
 
// Actions
export const actions = {
    saveInReducer: makeAsyncActionCreator('SAVE_IN_COMMONREDUCER'),
    UpdateReducer: makeAsyncActionCreator('UPDATE_COOMONREDUCER')
};
 
// Reducer
export const reducer = composeReducers({
    saveCommonData: makeAsyncReducer(actions.saveInReducer),
    updateCommonData: makeAsyncReducer(actions.UpdateReducer)
});
 
 
// Sagas
const saveCommonDataSaga = makeAsyncSaga(actions.saveInReducer, saveCommonDataService, { debug: true });
const getCommonDataSaga = makeAsyncSaga(actions.UpdateReducer, updateCommonDataService, { debug: true });
 
export const sagas = [
    saveCommonDataSaga(),
    getCommonDataSaga()
];