There is no util.throttle. This seems to block MobileFrontend removing this code or we will need to provide our own code. The solution for debounce is to use mw.util.debounce
$window .on( 'resize', apply2( util.debounce( 100, function () { eventBus.emit( 'resize' ); } ), $.throttle( 200, function () { eventBus.emit( 'resize:throttled' ); } ) ) ) .on( 'scroll', apply2( util.debounce( 100, function () { eventBus.emit( 'scroll' ); } ), $.throttle( 200, function () { eventBus.emit( 'scroll:throttled' ); } ) ) );
Acceptance criteria
- Replace $.debounce with mw.util.debounce
- Replace $.throttle with a standalone function or a new mw.util function (if that will be added)