Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function formStateReducer(state = INITIAL_STATE, a: BlockUIAction | UnblockUIAction) {
state = formGroupReducer(state, a);
switch (a.type) {
case BlockUIAction.TYPE: {
state = updateRecursive(
state,
s => setUserDefinedProperty(s, 'wasDisabled', s.isDisabled),
);
return disable(state);
}
case UnblockUIAction.TYPE: {
state = enable(state);
return updateRecursive(
state,
s => s.userDefinedProperties.wasDisabled ? disable(s) : s,
);
}
default: {
return state;
}
}
}
export function formStateReducer(state = INITIAL_STATE, a: BlockUIAction | UnblockUIAction) {
state = formGroupReducer(state, a);
switch (a.type) {
case BlockUIAction.TYPE: {
state = updateRecursive(
state,
s => setUserDefinedProperty(s, 'wasDisabled', s.isDisabled),
);
return disable(state);
}
case UnblockUIAction.TYPE: {
state = enable(state);
return updateRecursive(
state,
s => s.userDefinedProperties.wasDisabled ? disable(s) : s,
);
}
default: {
return state;