Skip to content

Commit 48ac2d2

Browse files
committed
Support action as a string in filters
Related to #591
1 parent 1035d42 commit 48ac2d2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/app/api/filters.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ export const noFiltersApplied = (localFilter) => (
2323
);
2424

2525
export function isFiltered(action, localFilter) {
26-
if (noFiltersApplied(localFilter) || typeof action.type.match !== 'function') return false;
26+
if (
27+
noFiltersApplied(localFilter) ||
28+
typeof action !== 'string' && typeof action.type.match !== 'function'
29+
) return false;
2730

2831
const { whitelist, blacklist } = localFilter || window.devToolsOptions || {};
32+
const actionType = action.type || action;
2933
return (
30-
whitelist && !action.type.match(whitelist) ||
31-
blacklist && action.type.match(blacklist)
34+
whitelist && !actionType.match(whitelist) ||
35+
blacklist && actionType.match(blacklist)
3236
);
3337
}
3438

0 commit comments

Comments
 (0)