PromucFlow_constructor/app/client/src/store.ts
Nikhil Nandagopal 288420f8ab added autocommit
added sentry in reducer
2020-08-28 17:01:07 +05:30

30 lines
881 B
TypeScript

import { reduxBatch } from "@manaflair/redux-batch";
import { createStore, applyMiddleware } from "redux";
import {
useSelector as useReduxSelector,
TypedUseSelectorHook,
} from "react-redux";
import appReducer, { AppState } from "./reducers";
import createSagaMiddleware from "redux-saga";
import { rootSaga } from "sagas";
import { composeWithDevTools } from "redux-devtools-extension/logOnlyInProduction";
import * as Sentry from "@sentry/react";
const sagaMiddleware = createSagaMiddleware();
const sentryReduxEnhancer = Sentry.createReduxEnhancer({
// Optionally pass options listed below
});
export default createStore(
appReducer,
composeWithDevTools(
reduxBatch,
applyMiddleware(sagaMiddleware),
reduxBatch,
sentryReduxEnhancer,
),
);
sagaMiddleware.run(rootSaga);
export const useSelector: TypedUseSelectorHook<AppState> = useReduxSelector;