A Guide on How to Cancel Duplicate Fetch Requests in JavaScript Enhanced Forms
Too Long; Didn't Read
There’s a good chance you’ve accidentally introduced a duplicate-request/race-condition bug. Today, I’ll walk you through the issue and my recommendations to avoid it. The key issue here is the`event.preventDefault()`. This method prevents the browser from performing the default behavior of loading the new page and submitting the form.