AOSSIE-Org / AOSSIE-Org/Rein

[Enhanacement]: Centralize gesture state reset logic in useTrackpadGesture

未关闭
#281 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
38
派生
78
平均合并
2 天 3 小时
30 天内合并 PR
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 摘要。