4 ms·
function onready () { recoll(); } document.addEventListener("DOMContentLoaded", onready); Just attach recoll() directly. There's no benefit of g
by onion2k 8y ago
function onready () {
recoll();
}
document.addEventListener("DOMContentLoaded", onready);
Just attach recoll() directly. There's no benefit of going via onready().
- lifthrasiir 8y ago`recoll(apse)` is a verb. `onready` is an event condition. They are not interchangable. (Though it might be combined into a single line with an anonymous function argument to addEventListener.)
- gpvos 8y agoYou don't have to make every piece of code 100% tight. onready is actually the kind of function that you very likely want to add more lines to in the future, so why not leave it in? (I'm willing to bet it had more lines at some point in the past.)
- onion2k 8y agoonready is actually the kind of function that you very likely want to add more lines to in the future, so why not leave it in? I'm a fan of writing the code you need when you need it. Adding or leaving things things there 'just in case' leads to code that's harder to reason about in the future because it's full of things that may or may not be used.
- deleted 8y ago[deleted]
- dang 8y agoOriginally there was something else in that function body. That's also why we didn't collapse it when we took that bit out.