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'
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 }) => (
)
export const Center = ({ 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;