useDeposit
A hook that accepts an original object, then allows you to edit it and run a save callback.
useDeposit(original, settings) ⇒
A hook that accepts an original object, then allows you to edit it and run a save callback.
Returns:
DepositControls - The controls of the deposit
Param | Type | Description |
---|---|---|
original | the original value to edit | |
settings | The settings of this deposit | |
settings.onSave | function | A callback function that will be called when the save function is called. NOTE: Must return a boolean indicating whether the save action was successful. NOTE: The param of this function ONLY returns the CHANGES to the original object. Any unchanged properties/values will not be included. |
settings.onEdit | function | A callback function that will be called when the edit function is called. |
settings.Discard | function | A callback function that will be called when the discard function is called. |
settings.autoSave | number | The number of milliseconds to wait before saving. |