[wp-trac] [WordPress Trac] #31812: Remove excess debounce + bind calls

WordPress Trac noreply at wordpress.org
Tue Mar 31 00:41:50 UTC 2015


#31812: Remove excess debounce + bind calls
--------------------------+-----------------------------
 Reporter:  evansolomon   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The function being called (`doSearch`) is already debounced and in the
 correct `this` context.  Calling `_.debounce(someFunction, timeout)(args)`
 is essentially the same thing as `setTimeout(function ()
 {someFunction(args)}, timeout)`, which doesn't really make sense here.

 Since `doSearch` is already debounced there's no reason for delaying the
 call to it, and which point there's no reason for binding to the current
 context, at which point it can just be a plain old boring function call.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31812>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list