Browse Source

fix(redux): remove unused variable

master
farhantock 6 months ago
parent
commit
766d873788
  1. 17
      src/appredux/actions.js
  2. 16
      src/appredux/reducers.js
  3. 15
      src/appredux/store.js

17
src/appredux/actions.js

@ -8,26 +8,15 @@ import {
setUser,
setFcmToken,
setChosenLanguage,
setScannedCode
setRegister
} from './modules/user/actions';
import {
setShipmentData,
setSelectedDropPoint,
setSelectedHistory,
setShowHistoryPicture,
setSelectedHistoryPicture
} from './modules/shipment/actions';
export {
setIsLogin,
setUser,
setFcmToken,
setChosenLanguage,
setShipmentData,
setSelectedDropPoint,
setScannedCode,
setSelectedHistory,
setShowHistoryPicture,
setSelectedHistoryPicture
setRegister
}

16
src/appredux/reducers.js

@ -4,11 +4,10 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
// modules
import userReducer from './modules/user/reducers';
import shipmentReducer from './modules/shipment/reducers';
const rootReducer = combineReducers({
userReducer,
shipmentReducer
userReducer
});
const appReducer = (state, action) => {
@ -22,16 +21,7 @@ const appReducer = (state, action) => {
const persistConfig = {
key: 'root',
storage: AsyncStorage,
blacklist: [], // to be not persisted
// transforms: [
// encryptTransform({
// secretKey: 'T25lc3Bpcml0MjAxOGdtc21vYmlsZQ',
// onError: function (error) {
// // Handle the error.
// console.log("encrypt redux persist error", error)
// },
// }),
// ]
blacklist: []
};
export default persistReducer(persistConfig, appReducer);

15
src/appredux/store.js

@ -1,5 +1,5 @@
import { configureStore } from "@reduxjs/toolkit";
import { applyMiddleware, compose, createStore} from "redux";
import { applyMiddleware, compose, createStore } from "redux";
// import thunk from "redux-thunk";
import { persistStore } from 'redux-persist';
import thunkMiddleware from 'redux-thunk';
@ -7,12 +7,7 @@ import persistedReducer from "./reducers";
const enhancers = [
applyMiddleware(
thunkMiddleware,
// createLogger({
// collapsed: true,
// // eslint-disable-next-line no-undef
// predicate: () => __DEV__,
// }),
thunkMiddleware
),
];
@ -27,9 +22,5 @@ const composeEnhancers =
const enhancer = composeEnhancers(...enhancers);
export const store = createStore(persistedReducer, {}, enhancer)
// export const store = configureStore(persistedReducer, enhancer);
// export const store = configureStore( {
// persistedReducer,
// enhancers: enhancer
// })
export const persistor = persistStore(store);
Loading…
Cancel
Save