AOSSIE-Org / AOSSIE-Org/Rein

[Enhanacement]: Centralize gesture state reset logic in useTrackpadGesture

オープン
#281 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
38
フォーク
78
平均マージ
2日 3時間
マージ済み PR(30日)
6

説明

Currently, the gesture state inside useTrackpadGesture is reset in multiple places across the hook. This makes the logic harder to maintain and increases the risk of missing a state variable when new gesture states are introduced.

A helper function can be introduced to centralize the reset logic for all gesture-related refs.

```Javascript
const resetGestureState = () => {
ongoingTouches.current.clear()
moved.current = false
releasedCount.current = 0
dragging.current = false
lastPinchDist.current = null
pinching.current = false

if (draggingTimeout.current) {
clearTimeout(draggingTimeout.current)
draggingTimeout.current = null
}
}
```

Cleaner gesture lifecycle management and easier future extensions to the gesture system.

Please assign this to me !!

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。