Skip to content

Commit

Permalink
Add regex support
Browse files Browse the repository at this point in the history
Fix #5.
  • Loading branch information
zalmoxisus committed Feb 6, 2016
1 parent 9acb5c0 commit 26e8293
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ Also, you can wrap it into the [`DockMonitor`](https://github.com/gaearon/redux-

Name | Description
------------- | -------------
`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).
`blacklist` | An array of actions (regex as string) to be hidden in the child monitor.
`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).

### License

Expand Down
4 changes: 2 additions & 2 deletions src/FilterMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export default class FilterMonitor extends Component {

isFiltered(action) {
return (
this.props.whitelist && this.props.whitelist.indexOf(action) !== -1 ||
this.props.blacklist && this.props.blacklist.indexOf(action) === -1
this.props.whitelist && action.match(this.props.whitelist.join('|')) ||
this.props.blacklist && !action.match(this.props.blacklist.join('|'))
);
}

Expand Down

0 comments on commit 26e8293

Please sign in to comment.