Closed KES777 closed 3 years ago
As for the naming of the functions, it's a design decision made in the beginning. I tend to use verbose naming of functions, as it as clear in the moment you look at it at the first time, without knowing anyhting else. So, changhing to root function naming here is not a thing a want to. Same goes for existing options.
As for the shorthand for new FormDataJsonOptions - This could be a thing, for sure.
As for the "reset" idea, this sound interesting.
Agree with you that long names are good for reading. But in any case for each option/function I must read documentation to understand details. So actually it has no matter it would be named as two words or five words. In any case developer will read documentation.
So at long term developer must spent his time forever
by typing long words without no benefit. (no benefit - because he read documentation in any case). Good names should be 5-10 chars long.
But this is just my point of view. Thank you for explanation
Thanks for your point of view. I understand your opinion as well.
A new pre-release does exist. https://github.com/brainfoolong/form-data-json/releases from branch https://github.com/brainfoolong/form-data-json/tree/v2-dev - Maybe you give it a shot. I took your feedback into consideration and refactored the hole thing as it has a few flaws that i didn't liked.
Thank you for release, it works like a charm.
Thank you for renames, I like them.
For another notices I open different issues.
It seems too verbose to write each time:
new FormDataJsonOptions
. To pass values we could just pass a simple hash. If this is required by code then this hash could be turned intoFormDataJsonOptions
internallyalso these methods
fillFormFromJsonValues
,formToJson
could be simplified to:fillForm
,readForm
ortoForm
,toJson
. Is there any reason for long typing?unsetAllInputsOnFill
->clearForm
. +implementresetForm
. Different is thatclearForm
- clears all inputs,resetForm
set default form values if there is not corresponding value at supplied hash.Thank you