There is this post that talks about how to fire a function once the user is done typing. How can this be implemented in an aura component? This is what I have so far, but it doesn't work.
<aura:component controller="SearchController" implements="forceCommunity:availableForAllPageTypes">
<aura:attribute name="searchValue" type="String"/>
<aura:attribute name="articles" type="List" default="[]"/>
<aura:attribute name="timer" type="Object"/>
<span onkeyup="{!c.onKeyUpHandler}" onkeydown="{!c.onKeyDownHandler}">
<lightning:input aura:id="searchValue"
type="search"
placeholder="Enter text..."
class="fl sidenav-search"/>
</span>
</aura:component>
component.js
onKeyUpHandler:function(component, event, helper) {
let timer = component.get("v.timer");
timer = setTimeout(helper.handleSearch(component,event,helper), 1000)
component.set("v.timer", timer);
},
onKeyDownHandler:function(component) {
let timer = component.get("v.timer");
clearTimeout(timer);
component.set("v.timer", timer);
}