Additional stable refactors, redux deprecation, substr deprecation. Clearing stage as to not lose low risk work.
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -100,7 +100,7 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
|
||||
"UNKNOWN",
|
||||
})
|
||||
: ""
|
||||
}`.substr(0, 239),
|
||||
}`.slice(0, 239),
|
||||
inservicedate: dayjs("2019-01-01"),
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import { createStore, applyMiddleware, compose } from "redux";
|
||||
import { persistStore } from "redux-persist";
|
||||
import { configureStore } from '@reduxjs/toolkit';
|
||||
import {
|
||||
persistStore,
|
||||
FLUSH,
|
||||
REHYDRATE,
|
||||
PAUSE,
|
||||
PERSIST,
|
||||
PURGE,
|
||||
REGISTER
|
||||
} from "redux-persist";
|
||||
import { createLogger } from "redux-logger";
|
||||
import createSagaMiddleware from "redux-saga";
|
||||
import {
|
||||
@@ -26,24 +34,23 @@ const middlewares = [
|
||||
sagaMiddleWare,
|
||||
createStateSyncMiddleware(reduxSyncConfig),
|
||||
];
|
||||
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
middlewares.push(createLogger({ collapsed: true, diff: true }));
|
||||
}
|
||||
//middlewares.push(Tracker.use(trackerRedux()));
|
||||
const composeEnhancers =
|
||||
typeof window === "object" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
||||
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
|
||||
// Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...
|
||||
})
|
||||
: compose;
|
||||
|
||||
const enhancer = composeEnhancers(
|
||||
applyMiddleware(...middlewares),
|
||||
sentryReduxEnhancer
|
||||
// other store enhancers if any
|
||||
);
|
||||
export const store = configureStore({
|
||||
reducer: rootReducer,
|
||||
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
||||
serializableCheck: {
|
||||
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
|
||||
},
|
||||
}).concat(middlewares),
|
||||
// middleware: middlewares,
|
||||
devTools: process.env.NODE_ENV !== 'production',
|
||||
enhancers: (getDefaultEnhancers) => getDefaultEnhancers().concat(sentryReduxEnhancer)
|
||||
});
|
||||
|
||||
export const store = createStore(rootReducer, enhancer);
|
||||
sagaMiddleWare.run(rootSaga);
|
||||
initMessageListener(store);
|
||||
|
||||
@@ -53,4 +60,4 @@ export default e;
|
||||
|
||||
if (window.Cypress) {
|
||||
window.store = store;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user