Skip to content

Commit

Permalink
Fiter actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zalmoxisus committed Dec 3, 2015
1 parent 000d511 commit 1c48edf
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/LogMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export default class LogMonitor extends Component {

preserveScrollTop: PropTypes.bool,
select: PropTypes.func.isRequired,
filter: PropTypes.shape({
whitelist: PropTypes.array,
blacklist: PropTypes.array
}),
theme: PropTypes.oneOfType([
PropTypes.object,
PropTypes.string
Expand Down Expand Up @@ -163,11 +167,19 @@ export default class LogMonitor extends Component {
render() {
const elements = [];
const theme = this.getTheme();
const { actionsById, skippedActionIds, stagedActionIds, computedStates, select } = this.props;
const { actionsById, skippedActionIds, stagedActionIds, computedStates, select, filter } = this.props;

for (let i = 0; i < stagedActionIds.length; i++) {
const actionId = stagedActionIds[i];
const action = actionsById[actionId].action;
if (
filter && (
filter.whitelist &&
filter.whitelist.indexOf(action.type) === -1 ||
filter.blacklist &&
filter.blacklist.indexOf(action.type) !== -1
)
) continue;
const { state, error } = computedStates[i];
let previousState;
if (i > 0) {
Expand Down

0 comments on commit 1c48edf

Please sign in to comment.