BackburnerJS / backburner.js

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

[BUGFIX] fix issue with rescheduling debounce #357

Closed bekzod closed 5 years ago

bekzod commented 5 years ago

fixes https://github.com/emberjs/ember.js/issues/17210

issue caused by incorrectly placing debounced function in _timers queue since executeAt changes each time so debounced function needs to move in _timers queue

bekzod commented 5 years ago

calling debounce continuously shifts added later callback, because bb takes first element in _timer queue to set main timer and when debounced element does not move and stay in same place main timer is continuously set with wrong timeout, and added test demonstrates that