shlink-web-client/src/container/store.js

22 lines
667 B
JavaScript
Raw Normal View History

import ReduxThunk from 'redux-thunk';
import { applyMiddleware, compose, createStore } from 'redux';
2020-05-03 21:16:21 +03:00
import { save, load } from 'redux-localstorage-simple';
import reducers from '../reducers';
const composeEnhancers = process.env.NODE_ENV !== 'production' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
: compose;
const localStorageConfig = {
states: [ 'settings', 'servers' ],
namespace: 'shlink',
namespaceSeparator: '.',
2020-05-03 21:16:21 +03:00
debounce: 300,
};
const store = createStore(reducers, load(localStorageConfig), composeEnhancers(
2020-08-22 09:10:31 +03:00
applyMiddleware(save(localStorageConfig), ReduxThunk),
));
export default store;