mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-03 23:07:26 +03:00
Configured redux dev tools
This commit is contained in:
parent
3c0f1716aa
commit
9575107848
3 changed files with 9 additions and 4 deletions
|
@ -3,7 +3,7 @@ import React from 'react';
|
|||
import ReactDOM from 'react-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
import { applyMiddleware, createStore } from 'redux';
|
||||
import { applyMiddleware, compose, createStore } from 'redux';
|
||||
import ReduxThunk from 'redux-thunk';
|
||||
|
||||
import App from './App';
|
||||
|
@ -11,7 +11,12 @@ import './index.scss';
|
|||
import reducers from './reducers';
|
||||
import registerServiceWorker from './registerServiceWorker';
|
||||
|
||||
const store = createStore(reducers, applyMiddleware(ReduxThunk));
|
||||
const composeEnhancers = process.env.NODE_ENV !== 'production' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
||||
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
||||
: compose;
|
||||
const store = createStore(reducers, composeEnhancers(
|
||||
applyMiddleware(ReduxThunk)
|
||||
));
|
||||
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
|
|
|
@ -5,7 +5,7 @@ const LIST_SHORT_URLS_ERROR = 'shlink/shortUrlsList/LIST_SHORT_URLS_ERROR';
|
|||
export const LIST_SHORT_URLS = 'shlink/shortUrlsList/LIST_SHORT_URLS';
|
||||
|
||||
const initialState = {
|
||||
shortUrls: [],
|
||||
shortUrls: {},
|
||||
loading: true,
|
||||
};
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import { LIST_SHORT_URLS } from './shortUrlsList';
|
|||
|
||||
const RESET_SHORT_URL_PARAMS = 'shlink/shortUrlsListParams/RESET_SHORT_URL_PARAMS';
|
||||
|
||||
const defaultState = { page: 1 };
|
||||
const defaultState = { page: '1' };
|
||||
|
||||
export default function reducer(state = defaultState, action) {
|
||||
switch (action.type) {
|
||||
|
|
Loading…
Reference in a new issue