Skip to content

Commit f722787

Browse files
committed
feat(*): add SHOW_DEVTOOLS env var to npm tasks
1 parent bae5203 commit f722787

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,12 @@ I'm using eslint, based on [eslint-config-airbnb](https://github.com/airbnb/java
136136

137137
####Specific commands
138138

139-
You may want some granularity, the `DEVTOOLS`, `NODE_ENV` & `LINTER` variables are at your disposal:
139+
You may want some granularity, the `DEVTOOLS`, `SHOW_DEVTOOLS`, `NODE_ENV` & `LINTER` variables are at your disposal:
140140

141141
* `DEVTOOLS=true npm run build`: will build a debug version with the devtools
142142
* `DEVTOOLS=false npm run webpack`: will launch a webpack dev server without the devtools (if you find it annoying)
143143
* `LINTER=false npm start` (if you don't want to be bothered by the linter - at your own risks! the pre-commit hook will run the linter and the tests anyway)
144+
* `SHOW_DEVTOOLS=false npm start` (if you want to hide the redux-devtools - you'll still be able to show them by `ctrl+H`)
144145
* ... you can mix and match ;-)
145146

146147
**Read the ["Advanced tasks" wiki section](https://github.com/topheman/react-es6-redux/wiki/Advanced-tasks) for more infos ...**

src/containers/Home/Home.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const devtoolsMessage = (<div>
1414
<p>This is the <strong>development packaged</strong> version (<a href="../" title="checkout in production mode">the production version is here</a>). In the current mode, you have access to:</p>
1515
<ul>
1616
<li>sourcemaps for <code>.scss</code>/<code>.js</code> (open the sources tab of your developer tools)</li>
17-
<li><a href="https://github.com/gaearon/redux-devtools" title="redux-devtools">redux devtools</a> (this is the tab you can see on the right - ctrl+H to toggle hide), it lets you play with history state of redux</li>
17+
<li><a href="https://github.com/gaearon/redux-devtools" title="redux-devtools">redux devtools</a> (this is the tab you can see on the right - ctrl+H to toggle hide - ctrl+Q to change position), it lets you play with history state of redux</li>
1818
</ul>
1919
<p>Those features are meant to be used only in the development but I felt it would be a great way to let you discover them.</p>
2020
</div>);

src/redux/DevTools.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const DevTools = createDevTools(
1313
// Consult their repositories to learn about those props.
1414
// Here, we put LogMonitor inside a DockMonitor.
1515
<DockMonitor toggleVisibilityKey="ctrl-h"
16-
changePositionKey="ctrl-q">
16+
changePositionKey="ctrl-q" defaultIsVisible={process.env.SHOW_DEVTOOLS}>
1717
<LogMonitor theme="tomorrow" />
1818
</DockMonitor>
1919
);

0 commit comments

Comments
 (0)