mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
[redux-devtools-inspector]: filter - use '!' to negate query
This commit is contained in:
parent
03d1448dc3
commit
04434f5c55
|
@ -94,13 +94,19 @@ export default class ActionList extends Component {
|
||||||
onJumpToState
|
onJumpToState
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const lowerSearchValue = searchValue && searchValue.toLowerCase();
|
const lowerSearchValue = searchValue && searchValue.toLowerCase();
|
||||||
const filteredActionIds = searchValue
|
|
||||||
? actionIds.filter(
|
const shouldMatchNegative = lowerSearchValue && lowerSearchValue.indexOf('!') === 0;
|
||||||
id =>
|
const query = shouldMatchNegative ? lowerSearchValue.substring(1) : lowerSearchValue;
|
||||||
actions[id].action.type.toLowerCase().indexOf(lowerSearchValue) !==
|
|
||||||
-1
|
const filterFunction = id => {
|
||||||
)
|
const actionIndex = actions[id].action.type.toLowerCase().indexOf(query);
|
||||||
: actionIds;
|
if (shouldMatchNegative) {
|
||||||
|
return actionIndex === -1;
|
||||||
|
}
|
||||||
|
return actionIndex !== -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
const filteredActionIds = searchValue ? actionIds.filter(filterFunction) : actionIds;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
Loading…
Reference in New Issue
Block a user