Skip to content

Commit

Permalink
Update the README
Browse files Browse the repository at this point in the history
Related to #2.
  • Loading branch information
zalmoxisus committed Dec 26, 2015
1 parent 1991848 commit 3652532
Showing 1 changed file with 13 additions and 25 deletions.
38 changes: 13 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,43 @@
Redux DevTools Log Monitor Filterable
=====================================
Redux DevTools Filter Actions
==============================

A fork of [Redux DevTools Log Monitor](https://github.com/gaearon/redux-devtools-log-monitor) with the ability to specify actions to be hidden or shown in DevTools.
A composable monitor for [Redux DevTools](https://github.com/gaearon/redux-devtools) with the ability to specify actions to be hidden (blacklisted) or shown (whitelisted).

### Installation

```
npm install --save-dev redux-devtools-log-monitor-filterable
npm install --save-dev redux-devtools-filter-actions
```

### Usage

You can use `LogMonitor` as the only monitor in your app:
Wrap any other Redux DevTools monitor in `FilterMonitor`. For example, you can use it together with [`LogMonitor`](https://github.com/gaearon/redux-devtools-log-monitor):

##### `containers/DevTools.js`

```js
import React from 'react';
import { createDevTools } from 'redux-devtools';
import LogMonitor from 'redux-devtools-log-monitor-filterable';
import FilterMonitor from 'redux-devtools-filter-actions';
import LogMonitor from 'redux-devtools-log-monitor';

export default createDevTools(
<LogMonitor filter={{ blacklist: ['ACTION1', 'ACTION2'], whitelist: ['ACTION1', 'ACTION2'] }} />
<FilterMonitor blacklist={['ACTION1', 'ACTION2']}>
<LogMonitor />
</FilterMonitor>
);
```

Then you can render `<DevTools>` to any place inside app or even into a separate popup window.

Alternative, you can use it together with [`DockMonitor`](https://github.com/gaearon/redux-devtools-dock-monitor) to make it dockable.
Consult the [`DockMonitor` README](https://github.com/gaearon/redux-devtools-dock-monitor) for details of this approach.
Also, you can wrap it into the [`DockMonitor`](https://github.com/gaearon/redux-devtools-dock-monitor) to make it dockable.

[Read how to start using Redux DevTools.](https://github.com/gaearon/redux-devtools)

### Features

Only filtered actions are displayed in the log. You can expand the tree view to inspect the `action` object and the `state` after it.

If a reducer throws while handling an action, you will see “Interrupted by an error up the chain” instead of the state and action tree view. Scroll up until you find the action which caused the error. You will see the error message in the action log entry. If you use a hot reloading tool, you can edit the reducer, and the error will automatically update or go away.

Clicking an action will disable it. It will appear crossed out, and the state will be recalculated as if the action never happened. Clicking it once again will enable it back. Use this together with a hot reloading solution to work sequentially on different states of your app without reproducing them by hand. You can toggle any action except for the initial one.

There are four buttons at the very top. “Reset” takes your app to the state you created the store with. The other three buttons work together. You might find it useful to think of them like you think of Git commits. “Commit” removes all actions in your log, and makes the current state your initial state. This is useful when you start working on a feature and want to remove the previous noise. After you’ve dispatched a few actions, you can press “Revert” to go back to the last committed state. Finally, if you dispatched some actions by mistake and you don’t want them around, you can toggle them by clicking on them, and press “Sweep” to completely remove all currently disabled actions from the log.

### Props

Name | Description
------------- | -------------
`theme` | Either a string referring to one of the themes provided by [redux-devtools-themes](https://github.com/gaearon/redux-devtools-themes) (feel free to contribute!) or a custom object of the same format. Optional. By default, set to [`'nicinabox'`](https://github.com/gaearon/redux-devtools-themes/blob/master/src/nicinabox.js).
`select` | A function that selects the slice of the state for DevTools to show. For example, `state => state.thePart.iCare.about`. Optional. By default, set to `state => state`.
`preserveScrollTop` | When `true`, records the current scroll top every second so it can be restored on refresh. This only has effect when used together with `persistState()` enhancer from Redux DevTools. By default, set to `true`.
`filter` | An object with `blacklist` or `whitelist` arrays, which specify either actions to be hidden or shown in DevTools. If the latter is specified, other than those actions will be hidden.
`blacklist` | An array of actions to be hidden in the child monitor.
`whitelist` | An array of actions to be shown. If specified, other than those actions will be hidden (the 'blacklist' parameter will be ignored).

### License

0 comments on commit 3652532

Please sign in to comment.