drizzle icon indicating copy to clipboard operation
drizzle copied to clipboard

Dispatch Not Reaching Saga

Open spoonknife22 opened this issue 4 years ago • 2 comments

I am using generatestore and the Reducer is update when I dispatch an action but it does reach the Saga. Everything seems to work. I can use createStore and it does work. Please let me know if you see something wrong with my code. Thanks

import appSagas from '../../middleware/rootSaga'; import reducer from '../../middleware/reducer.js'

const contractEventNotifier = contractEventSaga; const joinTransactionComplete = joinTransactionSaga; const appMiddlewares = [ contractEventNotifier(), joinTransactionComplete ]; const appReducers = {appReducers: reducer};

const store = generateStore({ drizzleOptions, appReducers, ...appSagas, appMiddlewares, disableReduxDevTools:false })

const drizzle = new Drizzle(drizzleOptions, store);

export const Page = ({ children }) => (

{children}
)

export const Center = ({ children }) => (

{children}
)

//////////////////////////////////////////////////////////////

const TEST_SAGA = 'TEST_SAGA';

function* testSaga () { yield put({ type: 'TESTED_SAGA' }); }

function* appRootSaga() { yield takeLatest('TEST_SAGA', testSaga); }

export default appRootSaga;

//////////////////////////////////////////////////////////////

const TESTED_SAGA = 'TESTED_SAGA';

const initialState = { testedSaga:false };

function appReducers(state = initialState, action) { switch (action.type) { case TESTED_SAGA: return { ...state, testedSaga: true }; default: return state; } }

export default appReducers;

spoonknife22 avatar Nov 04 '20 21:11 spoonknife22

facing the same issue here, any idea?

ashalfarhan avatar Jul 03 '21 18:07 ashalfarhan