Redux persist配置

import { createStore, applyMiddleware, compose } from 'redux';

import thunk from 'redux-thunk';

import reducers from './reducer'

// import {persistStore,persistReducer} from 'redux-persist';

// import storage from 'redux-persist/lib/storage';

 

// import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2';

 

const composeEnhancers =window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose;

// const persistConfig = {

// key: 'root',

// storage,

// stateReconciler: autoMergeLevel2

// };

const enhancer = composeEnhancers(

applyMiddleware(thunk)

);

// const myPersistReducer = persistReducer(persistConfig, reducers)

const store = createStore(reducers,enhancer);

// export const persistor = persistStore(store)

export default store;

 

 

 

 

import React from 'react'

import ReactDOM from 'react-dom'

import 'antd-mobile/dist/antd-mobile.css';

import Router from './router'

import store from './store'

// import { persistor } from './store'

import { Provider } from 'react-redux';

// import { PersistGate } from 'redux-persist/integration/react';

ReactDOM.render(

{/* */}

{/* */}

, document.getElementById('root'));

你可能感兴趣的:(Redux persist配置)