Skip to content

Commit 26e8293

Browse files
committed
Add regex support
Fix #5.
1 parent 9acb5c0 commit 26e8293

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ Also, you can wrap it into the [`DockMonitor`](https://github.com/gaearon/redux-
3636

3737
Name | Description
3838
------------- | -------------
39-
`blacklist` | An array of actions to be hidden in the child monitor.
40-
`whitelist` | An array of actions to be shown. If specified, other than those actions will be hidden (the 'blacklist' parameter will be ignored).
39+
`blacklist` | An array of actions (regex as string) to be hidden in the child monitor.
40+
`whitelist` | An array of actions (regex as string) to be shown. If specified, other than those actions will be hidden (the 'blacklist' parameter will be ignored).
4141

4242
### License
4343

src/FilterMonitor.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export default class FilterMonitor extends Component {
1212

1313
isFiltered(action) {
1414
return (
15-
this.props.whitelist && this.props.whitelist.indexOf(action) !== -1 ||
16-
this.props.blacklist && this.props.blacklist.indexOf(action) === -1
15+
this.props.whitelist && action.match(this.props.whitelist.join('|')) ||
16+
this.props.blacklist && !action.match(this.props.blacklist.join('|'))
1717
);
1818
}
1919

0 commit comments

Comments
 (0)