JSFiddle - React, Tailwind, and code Playground

HTML

<input onkeyup="lazyInputSearchDaemon.listen(this)">

JavaScript

lazyInputSearchDaemon = {
        '___typeTimer': false,
        '___query': '',

        listen: function(element) {
            that = this;
            this.___query = element.value;
            clearTimeout(this.___typeTimer);
            this.___typeTimer = setTimeout(function() {
                if (that.___query.length >= 10) {
                    that.go()
                }   
            }, 2000)
        },

        go: function() {
            alert(this.___query)
        }
    }