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
fb577ce1
Commit
fb577ce1
authored
Sep 29, 2017
by
Andrew Hrdy
Browse files
Fixed error where webpage crashes if the Redux dev extension is not installed.
parent
f3d9d484
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/index.js
View file @
fb577ce1
...
...
@@ -19,13 +19,18 @@ 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
extension
=
window
.
__REDUX_DEVTOOLS_EXTENSION__
&&
window
.
__REDUX_DEVTOOLS_EXTENSION__
();
if
(
extension
){
const
enhance
=
compose
(
let
enhance
;
if
(
extension
)
{
enhance
=
compose
(
applyMiddleware
(
ReduxThunk
,
routerMiddleware
(
history
))
,
extension
);
}
const
enhance
=
compose
(
}
else
{
enhance
=
compose
(
applyMiddleware
(
ReduxThunk
,
routerMiddleware
(
history
)));
}
const
store
=
createStore
(
reducers
,
enhance
);
const
theme
=
createMuiTheme
({
...
...
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