Comparing version 2.0.9 to 2.0.10
@@ -121,5 +121,4 @@ "use strict"; | ||
errors: {}, | ||
values: {}, | ||
dirty: {}, | ||
validations: _objectSpread({}, state.validations) | ||
values: _objectSpread({}, action.payload.initialValue) | ||
}); | ||
@@ -151,3 +150,5 @@ break; | ||
newState.valid = valid; | ||
action.onChange && action.onChange(newState); | ||
action.onChange && action.onChange(_objectSpread({}, newState, { | ||
action: action.type | ||
})); | ||
return newState; | ||
@@ -219,2 +220,5 @@ }; | ||
type: 'CLEAR', | ||
payload: { | ||
initialValue: initialValue | ||
}, | ||
onChange: onChange | ||
@@ -221,0 +225,0 @@ }); |
{ | ||
"name": "formact", | ||
"version": "2.0.9", | ||
"version": "2.0.10", | ||
"description": "Context for React form components with validation", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -24,2 +24,3 @@ // @flow | ||
errors: Object, | ||
action: string, | ||
} | ||
@@ -122,2 +123,5 @@ | ||
type: 'CLEAR', | ||
payload: { | ||
initialValue: Object, | ||
}, | ||
onChange?: (payload: FormChangePayload) => any, | ||
@@ -213,7 +217,4 @@ } | ||
errors: {}, | ||
values: {}, | ||
dirty: {}, | ||
validations: { | ||
...state.validations, | ||
}, | ||
values: { ...action.payload.initialValue }, | ||
} | ||
@@ -249,3 +250,3 @@ break | ||
action.onChange && action.onChange(newState) | ||
action.onChange && action.onChange({ ...newState, action: action.type }) | ||
@@ -314,2 +315,3 @@ return newState | ||
type: 'CLEAR', | ||
payload: { initialValue }, | ||
onChange, | ||
@@ -316,0 +318,0 @@ }) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35551
834