jquery.turbolinks
jquery.turbolinks copied to clipboard
Inconsistent behavior
There's currently inconsistency in the "isReady" / not states. Consider this part of (the compiled javascript):
if ($.turbo.isReady) {
return callback($);
} else {
return $document.on('turbo:ready', function() {
return callback($);
});
}
When it's ready, then the callback is executed only once (right away), and if it's not, then the callback is added on 'turbo:ready' for ever. I propose to change the "on()" to "one()" for consistency.
P.S. I found that while doing performance analysis of our application, and found multiple invocations of the "onready" callback.