import { combineReducers } from 'redux';
import { routerReducer } from 'react-router-redux';
import { gridListReducer } from 'Containers/GridList';
import { editorFormReducer } from 'Containers/EditorForm';
export default combineReducers({
routing: routerReducer,
templates: gridListReducer,
editorForm: editorFormReducer()
});
import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension'; // eslint-disable-line
import thunk from 'redux-thunk';
import { persistStore, persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
import rootReducer from './reducer';
const persistConfig = {
key: 'root',
debug: !(process.env.NODE_ENV === 'production'),
storage
};
const middleware =
process.env.NODE_ENV === 'production'
? applyMiddleware(thunk)
: composeWithDevTools(applyMiddleware(thunk));
const persistedReducer = persistReducer(persistConfig, rootReducer);
const configureStore = () => {
const store = createStore(persistedReducer, middleware);
const persistor = persistStore(store);
return { store, persistor };
};
export default configureStore;
import React from 'react';
import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import Layout from 'Components/Layout';
import IndexPage from 'Containers/Pages/Index';
import configureStore from './configureStore';
const { store, persistor } = configureStore();
const App = () => (
<Provider store={store}>
<PersistGate loading={<Spinner />} persistor={persistor}>
<Router>
<Layout>
<Switch>
<Route exact path="/mail-template" component={IndexPage} />
</Switch>
</Layout>
</Router>
</PersistGate>
</Provider>
);
export default App;
@supports (display: flex) {
.wrapper {
display: flex;
flex-wrap: wrap;
}
}
.clearfix::after {
content: "";
display: table;
clear: both;
}
Рекомендуется к просмотру.
Дебаггинг для Node.js.
Если коротко:
node --inspect-brk server.js