Skip to content

Commit

Permalink
Support action as a string in filters
Browse files Browse the repository at this point in the history
Related to #591
  • Loading branch information
zalmoxisus committed Nov 28, 2018
1 parent 1035d42 commit 48ac2d2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/api/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ export const noFiltersApplied = (localFilter) => (
);

export function isFiltered(action, localFilter) {
if (noFiltersApplied(localFilter) || typeof action.type.match !== 'function') return false;
if (
noFiltersApplied(localFilter) ||
typeof action !== 'string' && typeof action.type.match !== 'function'
) return false;

const { whitelist, blacklist } = localFilter || window.devToolsOptions || {};
const actionType = action.type || action;
return (
whitelist && !action.type.match(whitelist) ||
blacklist && action.type.match(blacklist)
whitelist && !actionType.match(whitelist) ||
blacklist && actionType.match(blacklist)
);
}

Expand Down

0 comments on commit 48ac2d2

Please sign in to comment.