title: Debouncing an action when changing Input value
body: <p>I'm trying to debounce an action when the value of an Input element is changed. This action is captured by a saga and an HTTP request is made.
  First I've tried to do:</p>
  
  <pre><code>&lt;Input
    name='name'
    value={this.props.finish.name}
    placeholder='Ex: My application'
    onChange={event =&gt; this.saveAppName(event.target.name, event.target.value)}
  /&gt;
  
  private saveAppName = debounce((name: string, value: string) =&gt; {
    if (value.length) {
      this.props.dispatch(changeInputFinish({name, value}));
    }
  }, 500);
  </code></pre>
  
  <p>The solution above worked but I can't type fast into the Input. If I do then the Input doesn't capture everything.</p>
  
  <p>After that I've tried to change "saveAppName" method to:</p>
  
  <pre><code>private saveAppName = (name: string, value: string) =&gt; {
    if (value.length) {
      debounce(this.props.dispatch(changeInputFinish({name, value})), 500);
    }
  }
  </code></pre>
  
  <p>The code above allows me to type anything as fast as I want inside the Input element but ends up retrieving an error and crashing the application. The error the is shown is "TypeError: Expected a function". It is an error from lodash debounce. It expects a function but the action "changeInputFinish({name, value})" returns an action object and not a function.</p>
  
  <p>To try to solve this issue I've tried to make the action return a new function instead of an action object with the code below:</p>
  
  <pre><code>private saveAppName = (name: string, value: string) =&gt; {
    if (value.length) {
      debounce(() =&gt; this.props.dispatch(changeInputFinish({name, value})), 500);
    }
  }
  </code></pre>
  
  <p>The code above doesn't retrieve any error but it doesn't let me type anything inside the Input, then I don't know if it's really the solution.</p>
  
  <p>Does anyone know how can I solve this issue? Basically, I need to debounce an action that is captured by a saga that makes http requests. Should I try to debounce on my saga and not on my component since I'm trying to improve the performance of my HTTP requests?</p>
  
  <p>Thank you.</p>