Closed rovolution closed 5 years ago
For future reference:
setTimeout()
with delay of 0. Under Late timeouts:
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout#Reasons_for_delays_longer_than_specified
@jespirit Thanks for the review! i updated with feedback. take a glance and let me know if it all looks good.
@jespirit just removed the changes + removed the default timeout amount of 0 in the unit tests (setTimeout
defaults to 0 seconds when a specific timeout is not specified)
@jespirit feel free to make the changes you want if you don't want me to block you. i probably will not have time to work on this
Background
After diving through our source code and tests, I realized a serious issue...none of our event listeners were executing asynchronously!
Though we were exposing a callback based API, the callbacks were being executed synchronously whenever the private method
_trigger()
was being executed.I wrapped the callback invocations in
setTimeout()
with a timeout of 0 (which cues the callback to be invoked on the next event loop tick) and fixed a bunch of our tests to reflect this.Pull Requests
Please accompany all pull requests with the following (where appropriate):
grunt test
in your Terminal within the bootstrap-slider repository directory