mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-25 15:40:06 +03:00
Remove unnecessary mapValues from extension
This commit is contained in:
parent
38af077a64
commit
f3f64490e3
|
@ -1,4 +1,3 @@
|
|||
import { mapValues } from 'lodash-es';
|
||||
import { Action } from 'redux';
|
||||
import { LiftedState, PerformAction } from '@redux-devtools/instrument';
|
||||
import { LocalFilter } from '@redux-devtools/utils';
|
||||
|
@ -46,10 +45,15 @@ function filterActions<A extends Action<string>>(
|
|||
actionSanitizer: ((action: A, id: number) => A) | undefined,
|
||||
): { [p: number]: PerformAction<A> } {
|
||||
if (!actionSanitizer) return actionsById;
|
||||
return mapValues(actionsById, (action, id) => ({
|
||||
...action,
|
||||
action: actionSanitizer(action.action, id as unknown as number),
|
||||
}));
|
||||
return Object.fromEntries(
|
||||
Object.entries(actionsById).map(([actionId, action]) => [
|
||||
actionId,
|
||||
{
|
||||
...action,
|
||||
action: actionSanitizer(action.action, actionId as unknown as number),
|
||||
},
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
function filterStates<S>(
|
||||
|
|
Loading…
Reference in New Issue
Block a user