Skip to content

Instantly share code, notes, and snippets.

@ArcanisCz
ArcanisCz / createProvider.js
Last active March 22, 2024 05:41
React Error Boundary, which can catch Component + Redux + Saga errors
/*
* Usage:
* const AppProvider = createProvider(rootReducer, rootSaga);
* ...
* <AppProvider>
* <AppComponent>
* </AppProvider>
*/
const createProvider = (reducer, saga) => {
const sagaMiddleware = createSagaMiddleware();