Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-web
Commits
f3d9d484
Commit
f3d9d484
authored
Sep 29, 2017
by
Andrew Hrdy
Browse files
Fixed error where webpage crashes if the Redux dev extension is not installed.
parent
b0644f33
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/index.js
View file @
f3d9d484
...
...
@@ -17,17 +17,16 @@ import amber from 'material-ui/colors/amber';
import
red
from
'
material-ui/colors/red
'
;
import
green
from
'
material-ui/colors/green
'
;
// Create a history of your choosing (we're using a browser history in this case)
const
history
=
createHistory
()
const
history
=
createHistory
()
;
const
extension
=
window
.
__REDUX_DEVTOOLS_EXTENSION__
&&
window
.
__REDUX_DEVTOOLS_EXTENSION__
();
if
(
extension
){
const
enhance
=
compose
(
applyMiddleware
(
ReduxThunk
,
routerMiddleware
(
history
))
,
extension
)
,
extension
)
;
}
const
enhance
=
compose
(
applyMiddleware
(
ReduxThunk
,
routerMiddleware
(
history
))
,
extension
)
const
store
=
createStore
(
reducers
,
enhance
)
applyMiddleware
(
ReduxThunk
,
routerMiddleware
(
history
)));
const
store
=
createStore
(
reducers
,
enhance
);
const
theme
=
createMuiTheme
({
palette
:
{
primary
:
blue
,
secondary
:
green
,
warn
:
amber
,
error
:
red
,
type
:
'
light
'
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment