Skip to content

Commit

Permalink
Allow blacklisting actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Boyt committed Jan 14, 2016
1 parent fbee23d commit 35be431
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/LogMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export default class LogMonitor extends Component {
initialScrollTop: PropTypes.number
}),

blacklist: PropTypes.array,

preserveScrollTop: PropTypes.bool,
select: PropTypes.func.isRequired,
theme: PropTypes.oneOfType([
Expand All @@ -67,7 +69,8 @@ export default class LogMonitor extends Component {
theme: 'nicinabox',
preserveScrollTop: true,
expandActionRoot: true,
expandStateRoot: true
expandStateRoot: true,
blacklist: []
};

shouldComponentUpdate = shouldPureComponentUpdate;
Expand Down Expand Up @@ -171,11 +174,16 @@ 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, blacklist } = this.props;

for (let i = 0; i < stagedActionIds.length; i++) {
const actionId = stagedActionIds[i];
const action = actionsById[actionId].action;

if (blacklist.indexOf(action.type) !== -1) {
continue;
}

const { state, error } = computedStates[i];
let previousState;
if (i > 0) {
Expand Down

0 comments on commit 35be431

Please sign in to comment.