-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chagarlamudi, Aneela
committed
Nov 17, 2021
1 parent
0e34d11
commit 43c67cf
Showing
6 changed files
with
36 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,27 @@ | ||
import React from 'react' | ||
import { render } from 'react-dom' | ||
import { createStore, applyMiddleware } from 'redux' | ||
import { Provider } from 'react-redux' | ||
import { createLogger } from 'redux-logger' | ||
import thunk from 'redux-thunk' | ||
import reducer from './reducers' | ||
import { getAllProducts, getAllDiscounts } from './actions' | ||
import App from './containers/App' | ||
import React from "react"; | ||
import { render } from "react-dom"; | ||
import { createStore, applyMiddleware } from "redux"; | ||
import { Provider } from "react-redux"; | ||
import { createLogger } from "redux-logger"; | ||
import thunk from "redux-thunk"; | ||
import reducer from "./reducers"; | ||
import { getAllProducts, getAllDiscounts } from "./actions"; | ||
import App from "./containers/App"; | ||
import 'bootstrap/dist/css/bootstrap.css'; | ||
|
||
const middleware = [ thunk ]; | ||
if (process.env.NODE_ENV !== 'production') { | ||
const middleware = [thunk]; | ||
if (process.env.NODE_ENV !== "production") { | ||
middleware.push(createLogger()); | ||
} | ||
|
||
const store = createStore( | ||
reducer, | ||
applyMiddleware(...middleware) | ||
) | ||
const store = createStore(reducer, applyMiddleware(...middleware)); | ||
|
||
store.dispatch(getAllProducts()) | ||
store.dispatch(getAllDiscounts()) | ||
store.dispatch(getAllProducts()); | ||
store.dispatch(getAllDiscounts()); | ||
|
||
render( | ||
<Provider store={store}> | ||
<App /> | ||
</Provider>, | ||
document.getElementById('root') | ||
) | ||
document.getElementById("root") | ||
); |