JSFiddle - React, Tailwind, and code Playground
HTML
<form id="form">
<div>
<input id="input" name="email" type="text"/>
</div>
</form>
<br/>
<strong> Start typing and you'll see that your action fire only when you stop typing</strong>
JavaScript
var timerid;
$("#input").on("input",function(e){
var value = $(this).val();
if($(this).data("lastval")!= value){
$(this).data("lastval",value);
clearTimeout(timerid);
timerid = setTimeout(function() {
//change action
alert(value);
},500);
};
});