trufflesuite / drizzle

Reactive Ethereum dapp UI suite
907 stars 238 forks source link

Dispatch Not Reaching Saga #106

Open spoonknife22 opened 3 years ago

spoonknife22 commented 3 years ago

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;

ashalfarhan commented 3 years ago

facing the same issue here, any idea?