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) {
|
if (matchedBehaviors.length) {
|
||||||
//Sanitize the payload using the reducer shape, then apply the sanitized
|
//Sanitize the payload using the reducer shape, then apply the sanitized
|
||||||
//payload to the state using the behavior linked to this action type.
|
//payload to the state using the behavior linked to this action type.
|
||||||
return reduce((interimState, matchedBehavior) => ({
|
return reduce((interimState, matchedBehavior) => behaviors[matchedBehavior.type].reducer(
|
||||||
...interimState,
|
|
||||||
...behaviors[matchedBehavior.type].reducer(
|
|
||||||
interimState,
|
interimState,
|
||||||
behaviors[matchedBehavior.type].validate
|
behaviors[matchedBehavior.type].validate
|
||||||
? validateShape(objectStructure, matchedBehavior.payload)
|
? validateShape(objectStructure, matchedBehavior.payload)
|
||||||
: matchedBehavior.payload,
|
: matchedBehavior.payload,
|
||||||
initialState
|
initialState,
|
||||||
)
|
), state)(matchedBehaviors);
|
||||||
}), state)(matchedBehaviors);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
|
|
Loading…
Reference in New Issue