Added first Typescript files

This commit is contained in:
Alejandro Celaya
2020-08-22 08:47:19 +02:00
parent a91f1b3bd4
commit 72de9d4ff8
8 changed files with 135 additions and 13 deletions

20
src/container/store.ts Normal file
View File

@@ -0,0 +1,20 @@
import ReduxThunk from 'redux-thunk';
import { applyMiddleware, compose, createStore } from 'redux';
import { save, load, RLSOptions } from 'redux-localstorage-simple';
import reducers from '../reducers';
const isProduction = process.env.NODE_ENV !== 'production';
const composeEnhancers: Function = !isProduction && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const localStorageConfig: RLSOptions = {
states: [ 'settings', 'servers' ],
namespace: 'shlink',
namespaceSeparator: '.',
debounce: 300,
};
const store = createStore(reducers, load(localStorageConfig), composeEnhancers(
applyMiddleware(save(localStorageConfig), ReduxThunk),
));
export default store;