All files / src/redux/ProProgress ProProgress.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 28 29 30 31 32 33 34 35                                                                     
import { makeAsyncReducer, makeAsyncActionCreator, composeReducers } from 'redux-toolbelt';
import { makeAsyncSaga } from 'redux-toolbelt-saga';
import { fetchProProgressFromServer, setSelectedProProgressToStore } from './service';
 
// Actions
export const actions = {
    fetchProProgressList: makeAsyncActionCreator('FETCH_PROPROGRESS'),
    setSelectedProProgress: makeAsyncActionCreator('SET_SELECTEDPROPROGRESS')
};
 
// Reducer
export const reducer = composeReducers({
    proProgressList: makeAsyncReducer(actions.fetchProProgressList),
    setSelectedProProgress: makeAsyncReducer(actions.setSelectedProProgress)
});
 
// Sagas
const fetchProProgressSaga = makeAsyncSaga(
    actions.fetchProProgressList,
    fetchProProgressFromServer,
    {
        debug: true
    }
);
 
const setSelectedProProgressSaga = makeAsyncSaga(
    actions.setSelectedProProgress,
    setSelectedProProgressToStore,
    {
        debug: true
    }
);
 
export const sagas = [fetchProProgressSaga(), setSelectedProProgressSaga()];