Skip to content

Commit 83e4ffc

Browse files
vagusX伊北
andauthored
feat: improve CacheMap impl (#161)
* feat: improve `CacheMap` impl * fix: lint error Co-authored-by: 伊北 <[email protected]>
1 parent 63b3b39 commit 83e4ffc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/hooks/useMobileTouchMove.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default function useMobileTouchMove(
1616
// Smooth scroll
1717
const intervalRef = useRef(null);
1818

19+
/* eslint-disable prefer-const */
1920
let cleanUpEvents: () => void;
2021

2122
const onTouchMove = (e: TouchEvent) => {

src/utils/CacheMap.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ class CacheMap {
55
maps: Record<string, number>;
66

77
constructor() {
8-
this.maps = {};
9-
this.maps.prototype = null;
8+
this.maps = Object.create(null);
109
}
1110

1211
set(key: React.ReactText, value: number) {

0 commit comments

Comments
 (0)