How can I optimize my axios http put requests to only be sent when an object changes?
I've noticed that unnecessary requests are being made, putting strain on the server. I want to limit this by only sending a request if the object has been updated or modified since it was initially loaded on the page.
One of the main reasons for this is that automatic saving on input via @blur is causing frequent http activity.
<input @blur="editInput()"></input>
The editInput()
method triggers an axios put http request every time. Is there a way to check for changes before making the request?
Should I clone the object in the created()
hook and then use a comparison method? This was my initial attempt but it didn't work as expected.