fix(Object): Prevent removed wildcard object properties persisting when replacing/resetting
This commit is contained in:
parent
c3d80b4223
commit
c0429059e8
File diff suppressed because it is too large
Load Diff
|
@ -118,16 +118,13 @@ export function createReducer(objectStructure: StructureType, behaviors: ShapeRe
|
|||
if (matchedBehaviors.length) {
|
||||
//Sanitize the payload using the reducer shape, then apply the sanitized
|
||||
//payload to the state using the behavior linked to this action type.
|
||||
return reduce((interimState, matchedBehavior) => ({
|
||||
...interimState,
|
||||
...behaviors[matchedBehavior.type].reducer(
|
||||
return reduce((interimState, matchedBehavior) => behaviors[matchedBehavior.type].reducer(
|
||||
interimState,
|
||||
behaviors[matchedBehavior.type].validate
|
||||
? validateShape(objectStructure, matchedBehavior.payload)
|
||||
: matchedBehavior.payload,
|
||||
initialState
|
||||
)
|
||||
}), state)(matchedBehaviors);
|
||||
initialState,
|
||||
), state)(matchedBehaviors);
|
||||
}
|
||||
|
||||
return state;
|
||||
|
|
Loading…
Reference in New Issue