| Total Complexity | 1 |
| Complexity/F | 0 |
| Lines of Code | 21 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import ReduxThunk from 'redux-thunk'; |
||
| 2 | import { applyMiddleware, compose, createStore } from 'redux'; |
||
| 3 | import { save, load } from 'redux-localstorage-simple'; |
||
| 4 | import reducers from '../reducers'; |
||
| 5 | |||
| 6 | const composeEnhancers = process.env.NODE_ENV !== 'production' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ |
||
| 7 | ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ |
||
| 8 | : compose; |
||
| 9 | |||
| 10 | const localStorageConfig = { |
||
| 11 | states: [ 'settings', 'servers' ], |
||
| 12 | namespace: 'shlink', |
||
| 13 | namespaceSeparator: '.', |
||
| 14 | debounce: 300, |
||
| 15 | }; |
||
| 16 | |||
| 17 | const store = createStore(reducers, load(localStorageConfig), composeEnhancers( |
||
| 18 | applyMiddleware(save(localStorageConfig), ReduxThunk) |
||
| 19 | )); |
||
| 20 | |||
| 21 | export default store; |
||
| 22 |