Created
November 30, 2021 13:33
-
-
Save Sidnioulz/2b75606507dacf987b2751ba469ff9b2 to your computer and use it in GitHub Desktop.
Simplified version of our saga test runner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function configureStore(someSaga, someReducer, initialState = {}) { | |
const dispatched = [] | |
const sagaMiddleware = createSagaMiddleware({ | |
sagaMonitor: { | |
actionDispatched: (action) => dispatched.push(action), | |
}, | |
}) | |
const store = createStore(moduleReducer, initialState, applyMiddleware(sagaMiddleware)) | |
sagaMiddleware.run(someSaga) | |
return { store, dispatched } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment