What I want to achieve is something like this:
- When the user clicks on Submit button, in the background I need to compare if the state of the form has changed, by state I mean if there is at least one change in the form and only then call the API/Server to save information.
- If there are not any changes, just show a warning message to the user - "Hey you need to update something!"(console.log() is enough)
- *I also need to handle this case when the user changes something in the field1, for example, from carrot to tasty carrot and then again back to a carrot(don't call API).
At the moment I have something like this - code example
Is it possible to do that using pristine/dirty/touched/untouched properties?