mirror of
https://github.com/aleleba/create-react-ssr.git
synced 2025-07-04 03:38:34 -06:00
PR-753737: Se agrega soporte para typescript.
This commit is contained in:
26
src/frontend/setStore.js
Normal file
26
src/frontend/setStore.js
Normal file
@ -0,0 +1,26 @@
|
||||
// Redux
|
||||
import { createStore } from 'redux'; //, applyMiddleware
|
||||
// import { Provider } from 'react-redux';
|
||||
import { composeWithDevTools as composeWithDevToolsWeb } from 'redux-devtools-extension';
|
||||
import { config } from '../config';
|
||||
import reducer from './reducers';
|
||||
|
||||
const { env } = config;
|
||||
|
||||
const composeEnhancers = composeWithDevToolsWeb({
|
||||
// Specify here name, actionsBlacklist, actionsCreators and other options
|
||||
});
|
||||
|
||||
const setStore = ({ initialState }) => {
|
||||
const store = env === 'development' ? createStore(
|
||||
reducer,
|
||||
initialState,
|
||||
composeEnhancers(),
|
||||
) : createStore(
|
||||
reducer,
|
||||
initialState,
|
||||
);
|
||||
return store;
|
||||
};
|
||||
|
||||
export default setStore;
|
Reference in New Issue
Block a user