computeDir(x, y) { if (Math.abs(x) > Math.abs(y)) return x > 0 ? 'right' : 'left'; else return y > 0 ? 'bottom' : 'top'; }, const direction = this.computeDir(x, y);
computeDir(x, y) { if (Math.abs(x) > Math.abs(y)) return x > 0 ? 'right' : 'left'; else return y > 0 ? 'bottom' : 'top'; }, const direction = this.computeDir(x, y);