Skip to content

Commit 3d137ff

Browse files
authored
[Web] Remove unnecessary overrides (#3257)
## Description This PR removes unnecessary overriden functions ## Test plan Run example app
1 parent b34a2de commit 3d137ff

10 files changed

+6
-52
lines changed

src/web/detectors/ScaleGestureDetector.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class ScaleGestureDetector implements ScaleGestureListener {
2929
private spanSlop: number;
3030
private minSpan: number;
3131

32-
public constructor(callbacks: ScaleGestureListener) {
32+
constructor(callbacks: ScaleGestureListener) {
3333
this.onScaleBegin = callbacks.onScaleBegin;
3434
this.onScale = callbacks.onScale;
3535
this.onScaleEnd = callbacks.onScaleEnd;

src/web/handlers/FlingGestureHandler.ts

-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ export default class FlingGestureHandler extends GestureHandler {
2626
private maxNumberOfPointersSimultaneously = 0;
2727
private keyPointer = NaN;
2828

29-
public init(ref: number, propsRef: React.RefObject<unknown>): void {
30-
super.init(ref, propsRef);
31-
}
32-
3329
public updateGestureConfig({ enabled = true, ...props }: Config): void {
3430
super.updateGestureConfig({ enabled: enabled, ...props });
3531

src/web/handlers/GestureHandler.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ export default abstract class GestureHandler implements IGestureHandler {
4343

4444
protected delegate: GestureHandlerDelegate<unknown, IGestureHandler>;
4545

46-
public constructor(
47-
delegate: GestureHandlerDelegate<unknown, IGestureHandler>
48-
) {
46+
constructor(delegate: GestureHandlerDelegate<unknown, IGestureHandler>) {
4947
this.delegate = delegate;
5048
}
5149

src/web/handlers/HoverGestureHandler.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
import { State } from '../../State';
2-
import { AdaptedEvent, Config, StylusData } from '../interfaces';
2+
import { AdaptedEvent, StylusData } from '../interfaces';
33
import GestureHandlerOrchestrator from '../tools/GestureHandlerOrchestrator';
44
import GestureHandler from './GestureHandler';
55

66
export default class HoverGestureHandler extends GestureHandler {
77
private stylusData: StylusData | undefined;
88

9-
public init(ref: number, propsRef: React.RefObject<unknown>) {
10-
super.init(ref, propsRef);
11-
}
12-
139
protected transformNativeEvent(): Record<string, unknown> {
1410
return {
1511
...super.transformNativeEvent(),
1612
stylusData: this.stylusData,
1713
};
1814
}
1915

20-
public updateGestureConfig({ enabled = true, ...props }: Config): void {
21-
super.updateGestureConfig({ enabled: enabled, ...props });
22-
}
23-
2416
protected onPointerMoveOver(event: AdaptedEvent): void {
2517
GestureHandlerOrchestrator.getInstance().recordHandlerIfNotPresent(this);
2618

src/web/handlers/ManualGestureHandler.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
import { AdaptedEvent, Config } from '../interfaces';
1+
import { AdaptedEvent } from '../interfaces';
22
import GestureHandler from './GestureHandler';
33

44
export default class ManualGestureHandler extends GestureHandler {
5-
public init(ref: number, propsRef: React.RefObject<unknown>) {
6-
super.init(ref, propsRef);
7-
}
8-
9-
public updateGestureConfig({ enabled = true, ...props }: Config): void {
10-
super.updateGestureConfig({ enabled: enabled, ...props });
11-
}
12-
135
protected onPointerDown(event: AdaptedEvent): void {
146
this.tracker.addToTracker(event);
157
super.onPointerDown(event);

src/web/handlers/NativeViewGestureHandler.ts

-4
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ export default class NativeViewGestureHandler extends GestureHandler {
5555
view.style['WebkitTouchCallout'] = 'auto';
5656
}
5757

58-
protected resetConfig(): void {
59-
super.resetConfig();
60-
}
61-
6258
protected onPointerDown(event: AdaptedEvent): void {
6359
this.tracker.addToTracker(event);
6460
super.onPointerDown(event);

src/web/handlers/PanGestureHandler.ts

-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ export default class PanGestureHandler extends GestureHandler {
6161
private endWheelTimeout = 0;
6262
private wheelDevice = WheelDevice.UNDETERMINED;
6363

64-
public init(ref: number, propsRef: React.RefObject<unknown>): void {
65-
super.init(ref, propsRef);
66-
}
67-
6864
public updateGestureConfig({ enabled = true, ...props }: Config): void {
6965
this.resetConfig();
7066

src/web/handlers/PinchGestureHandler.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { State } from '../../State';
22
import { DEFAULT_TOUCH_SLOP } from '../constants';
3-
import { AdaptedEvent, Config } from '../interfaces';
3+
import { AdaptedEvent } from '../interfaces';
44

55
import GestureHandler from './GestureHandler';
66
import ScaleGestureDetector, {
@@ -55,10 +55,6 @@ export default class PinchGestureHandler extends GestureHandler {
5555
this.setShouldCancelWhenOutside(false);
5656
}
5757

58-
public updateGestureConfig({ enabled = true, ...props }: Config): void {
59-
super.updateGestureConfig({ enabled: enabled, ...props });
60-
}
61-
6258
protected transformNativeEvent() {
6359
return {
6460
focalX: this.scaleGestureDetector.getFocusX(),

src/web/handlers/RotationGestureHandler.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { State } from '../../State';
2-
import { AdaptedEvent, Config } from '../interfaces';
2+
import { AdaptedEvent } from '../interfaces';
33

44
import GestureHandler from './GestureHandler';
55
import RotationGestureDetector, {
@@ -50,10 +50,6 @@ export default class RotationGestureHandler extends GestureHandler {
5050
this.setShouldCancelWhenOutside(false);
5151
}
5252

53-
public updateGestureConfig({ enabled = true, ...props }: Config): void {
54-
super.updateGestureConfig({ enabled: enabled, ...props });
55-
}
56-
5753
protected transformNativeEvent() {
5854
return {
5955
rotation: this.rotation ? this.rotation : 0,
@@ -158,10 +154,6 @@ export default class RotationGestureHandler extends GestureHandler {
158154
this.begin();
159155
}
160156

161-
public activate(_force?: boolean): void {
162-
super.activate();
163-
}
164-
165157
protected onReset(): void {
166158
if (this.currentState === State.ACTIVE) {
167159
return;

src/web/handlers/TapGestureHandler.ts

-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ export default class TapGestureHandler extends GestureHandler {
3131

3232
private tapsSoFar = 0;
3333

34-
public init(ref: number, propsRef: React.RefObject<unknown>): void {
35-
super.init(ref, propsRef);
36-
}
37-
3834
public updateGestureConfig({ enabled = true, ...props }: Config): void {
3935
super.updateGestureConfig({ enabled: enabled, ...props });
4036

0 commit comments

Comments
 (0)