JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" />

JavaScript

(function () {
    var timeout;
    $('input').on('change keypress', function (e) {
        clearTimeout(timeout);
        timeout = setTimeout(function () {
            if ((e.keyCode == 13 && e.type == 'keypress') || e.type == 'change') {
                console.log(1);
            }
        }, 0);
    });
})();