It is recommended you use the action creators from inputActions
in props passed down from connectWithInputs
, since
they are pre-bound to the inputsConfig and dispatch. The unbound versions can be imported for calling
actions outside of connected components.
Thunk that validates change and dispatches setInputs
to update inputs changed. Returns a Promise where the
resolve function is passed the input states of inputs that were validated and the
reject function is passed the input states of inputs that are invalid
inputsConfig
(Object)change
(Object) key-value pairs of input key and new value to be validated and set if valid.meta
(Object) [optional] extra meta information to add to the action object(s)
Example change
{
email: '[email protected]',
name: 'larry'
}
Same as updateAndValidate, but all inputs are still considered pristine
after updating.
Creates an action that sets inputs state directly without validation.
inputsConfig
(Object)newInput
(Object)meta
(Object) [optional] extra meta information to add to the action object(s)
Example newInput:
{
email: {
value: '[email protected]'
error: '1234'
},
name: {
value: 'larry'
}
}
Thunk that dispatches setInputs
with new value properties only.
inputsConfig
(Object)newValues
(Object) key-value pairs of input key and new value to be set.meta
(Object) [optional] extra meta information to add to the action object(s)
Sets the error property for the given inputs.
inputsConfig
(Object)inputKeys
(Array) Array of input keys found in inputsConfig.meta
(Object) [optional] extra meta information to add to the action object(s)
Thunk that returns a Promise which resolves if all inputs are valid, rejects if one or more inputs are invalid. Triggers errors on inputs. resolve function is passed the input states of inputs that were validated reject function is passed the input states of inputs that are invalid
inputsConfig
(Object)inputKeys
(Array) [optional] Array of input keys found in inputsConfig. If no inputKeys are given, validates all inputs found in inputsConfig.meta
(Object) [optional] extra meta information to add to the action object(s)
Returns an action that when dispatched will reset the form values associated with the given inputsConfig to their defaultValue
and are considered pristine
.
inputsConfig
(Object)inputKeys
(Array) [optional] Array of input keys found in inputsConfig. If no inputKeys are given, resets all inputs found in inputsConfig.meta
(Object) [optional] extra meta information to add to the action object(s)
reduxMountPoint
- automatically added to every action fired, specifying which form it is associated withsuppressChange
- adding this to the meta object for any action creator will skip anyonChange
callbacks in the inputsConfigvalidate
- included when runningvalidateInputs
initialize
- included when runningintializeInputs
, sets all changed inputs topristine
reset
- included when runningresetInputs