Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function* downloadSeriesAsync(action) {
- try {
- let response = yield call(axios.get, '/content/series.json')
- yield put(downloadSeriesSuccess(response.data))
- }catch(e) {
- console.error(e);
- }
- }
- yield put(downloadSeriesSuccess(response.data))
- export default (state = [], action) => {
- console.log('Calling the with State', state);
- if (action.type === c.ADD_DOWNLOADED_SERIES) {
- let newState = { ...state };
- newState.series = [...newState.series, action.payload];
- return newState;
- }
- else {
- return state;
- }
- }
- export default (initialState={}) => {
- console.log('Initial State', initialState);
- const sagaMiddleware = createSagaMiddleware();
- const all = applyMiddleware(sagaMiddleware, consoleLog)(createStore)(appReducer, initialState);
- sagaMiddleware.run(rootSaga);
- return all;
- }
Add Comment
Please, Sign In to add comment