BackburnerJS / backburner.js

A rewrite of the Ember.js run loop as a generic microlibrary
MIT License
391 stars 80 forks source link

[BUGFIX] fix throttle final argument usage #273

Closed bekzod closed 6 years ago

bekzod commented 6 years ago

bb.debounce uses final/last argument passed to it while bb.throttle does not, this PR fixes it

  bb.debounce(null, debouncee, 'car', 10);
  bb.debounce(null, debouncee, 'bus', 10);
// would call debouncee with `bus`

  bb.throttle(null, throttled, 'car' , 10, false);
  bb.throttle(null, throttled, 'bus' , 10, false);
// before: would call throttled with `car`
// now: calls throttled with `bus`