Skip to content

Instantly share code, notes, and snippets.

@itaditya
Last active October 4, 2020 12:14
Show Gist options
  • Save itaditya/19a07eb66642437207a5611f4c91482d to your computer and use it in GitHub Desktop.
Save itaditya/19a07eb66642437207a5611f4c91482d to your computer and use it in GitHub Desktop.
(Blog) Build a Redux hooked app
// redux.js
const enableReduxDevTools = window.__REDUX_DEVTOOLS_EXTENSION__?.();
export function createReduxStore() {
const store = createStore(foodReducer, enableReduxDevTools);
return store;
}
// index.js
import { Provider } from 'react-redux';
import { createReduxStore } from './redux';
ReactDOM.render(
<Provider store={createReduxStore()}>
<App />
</Provider>,
rootElement,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment