Esanders added a comment.
It would've been nice to use the same function signature as OOUI, now we have
OO.ui.debounce( callback, wait [, immediate] );
//and
mw.util.debounce( wait, callback );
(ContentTranslation's utils also uses `callback, wait, immedate` as ported
from the same source as underscore.js)
Given we know that the arguments have to be `number` and `Function` it's not
too late to "fix" it with some type checks (and deprecating the old signature).
It would also be sensible to add the `immediate` arg, as it is generally
useful (e.g. https://gerrit.wikimedia.org/r/c/mediawiki/core/+/684059/)
//nb// jQuery.throttle also had an `immediate` arg, but put it in the middle
just to be difficult: `delay [, at_begin ], callback`
TASK DETAIL
https://phabricator.wikimedia.org/T213426
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Esanders
Cc: Seb35, Ladsgroup, BEANS-X2, Xover, Woolvia, Esanders, Krinkle, Aklapper,
gerritbot, Jdforrester-WMF, Volker_E, Schnark, Rivaldid, Galobtter, G1964j,
786, Trngsh15, Zekwn, Suran38, Biggs657, the0001, Invadibot, Mengs21,
Lalamarie69, Zabe, Selby, H0bby, Florian_COLLIN, AndreCstr, caldera,
maantietaja, XeroS_SkalibuR, Juan90264, Alter-paule, EgbeRef, NavinRizwi,
Beast1978, Un1tY, Vaibhav0199, Akuckartz, Hook696, Tinzawoo533, darthmon_wmde,
abi_, Kent7301, Onmir, joker88john, 94rain, DannyS712, CucyNoiD, Nandana,
Mirahamira, Tumzaaaa24, kostajh, Gaboe420, Mh-3110, Amorymeltzer, Giuliamocci,
Cpaulf30, Lahi, Gq86, Af420, Bsandipan, Markhalsey, GoranSMilovanovic,
Jayprakash12345, Nattes, QZanden, EBjune, enigmaeth, rohitt, EnricoCNC,
LawExplorer, spatton, Lewizho99, Maathavan, _jensen, Jseddon, rosalieper,
Taiwania_Justo, Neuronton, shinjiman, gabriel-wmde, Scott_WUaS, DStrine,
Dixtosa, XenoRyet, Izno, Wikidata-bugs, Base, matthiasmullie, aude, AndyRussG,
Pcoombe, geraki, Dinoguy1000, Gryllida, jeblad, Tacsipacsi, fbstj, Catrope,
Paladox, Nikerabbit, KartikMistry, Addshore, Mbch331, Jay8g
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]