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. 13
      src/appredux/store.js

17
src/appredux/actions.js

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

16
src/appredux/reducers.js

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

13
src/appredux/store.js

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