perf(all): minify better by using arrow functions (#18730)

This commit is contained in:
Manu MA
2019-07-10 16:33:33 +02:00
committed by Brandy Carney
parent 8beeff2c52
commit 03c1d19e07
99 changed files with 653 additions and 679 deletions

View File

@ -531,26 +531,26 @@ export class Menu implements ComponentInterface, MenuI {
}
}
function computeDelta(
const computeDelta = (
deltaX: number,
isOpen: boolean,
isEndSide: boolean
): number {
): number => {
return Math.max(0, isOpen !== isEndSide ? -deltaX : deltaX);
}
};
function checkEdgeSide(
const checkEdgeSide = (
win: Window,
posX: number,
isEndSide: boolean,
maxEdgeStart: number
): boolean {
): boolean => {
if (isEndSide) {
return posX >= win.innerWidth - maxEdgeStart;
} else {
return posX <= maxEdgeStart;
}
}
};
const SHOW_MENU = 'show-menu';
const SHOW_BACKDROP = 'show-backdrop';