Skip to content

Commit 3d15db0

Browse files
committed
Resolve conflicts
2 parents eb80170 + f028569 commit 3d15db0

File tree

3 files changed

+61
-6
lines changed

3 files changed

+61
-6
lines changed

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,23 +301,46 @@ Personal preferences vary, and whether to put the DevTools in a separate window,
301301

302302
Note that there are no useful props you can pass to the `DevTools` component other than the `store`. The `store` prop is needed if you don’t wrap `<DevTools>` in a `<Provider>`—just like with any connected component. To adjust the monitors, you need to pass props to them inside `DevTools.js` itself inside the `createDevTools()` call when they are used.
303303

304+
### Gotchas
305+
306+
* **Your reducers have to be pure and free of side effects to work correctly with DevTools.** For example, even generating a random ID in reducer makes it impure and non-deterministic. Instead, do this in action creators.
307+
308+
* **Make sure to only apply `DevTools.instrument()` and render `<DevTools>` in development!** In production, this will be terribly slow because actions just accumulate forever. As described above, you need to use conditional `require`s and use `ProvidePlugin` (Webpack) or `loose-envify` (Browserify) together with Uglify to remove the dead code. Here is [an example](https://github.com/erikras/react-redux-universal-hot-example/) that adds Redux DevTools handling the production case correctly.
309+
310+
* **It is important that `DevTools.instrument()` store enhancer should be added to your middleware stack *after* `applyMiddleware` in the `compose`d functions, as `applyMiddleware` is potentially asynchronous.** Otherwise, DevTools won’t see the raw actions emitted by asynchronous middleware such as [redux-promise](https://github.com/acdlite/redux-promise) or [redux-thunk](https://github.com/gaearon/redux-thunk).
311+
304312
### Running Examples
305313

306-
You can do this:
314+
Clone the project:
307315

308316
```
309317
git clone https://github.com/gaearon/redux-devtools.git
310318
cd redux-devtools
319+
```
320+
321+
Run `npm install` in the root folder:
322+
323+
```
311324
npm install
325+
```
326+
327+
Now you can open an example folder and run `npm install` there:
312328

329+
```
313330
cd examples/counter # or examples/todomvc
314331
npm install
332+
```
333+
334+
Finally, run the development server and open the page:
335+
336+
```
315337
npm start
316338
open http://localhost:3000
317339
```
318340

319-
Try clicking on actions in the log, or changing some code inside `examples/counter/reducers/counter`.
320-
For fun, you can also open `http://localhost:3000/?debug_session=123`, click around, and then refresh.
341+
Try clicking on actions in the log, or changing some code inside the reducers. You should see the action log re-evaluate the state on every code change.
342+
343+
Also try opening `http://localhost:3000/?debug_session=123`, click around, and then refresh. You should see that all actions have been restored from the local storage.
321344

322345
### Custom Monitors
323346

examples/counter/README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
# Redux DevTools Counter example
22

3-
## Running example
3+
## Running Example
4+
5+
First, clone the project:
46

57
```
68
git clone https://github.com/gaearon/redux-devtools.git
9+
```
10+
11+
Then install the dependencies in the root folder:
12+
13+
```
714
cd redux-devtools
815
npm install
16+
```
917

18+
Install the dependencies in the example folder:
19+
20+
```
1021
cd examples/counter
1122
npm install
23+
```
24+
25+
Finally, run the project:
26+
27+
```
1228
npm start
1329
open http://localhost:3000
1430
```

examples/todomvc/README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1-
# Redux DevTools TodoMVC example
1+
# Redux DevTools Counter example
22

3-
## Running example
3+
## Running Example
4+
5+
First, clone the project:
46

57
```
68
git clone https://github.com/gaearon/redux-devtools.git
9+
```
10+
11+
Then install the dependencies in the root folder:
12+
13+
```
714
cd redux-devtools
815
npm install
16+
```
917

18+
Install the dependencies in the example folder:
19+
20+
```
1021
cd examples/todomvc
1122
npm install
23+
```
24+
25+
Finally, run the project:
26+
27+
```
1228
npm start
1329
open http://localhost:3000
1430
```

0 commit comments

Comments
 (0)