Skip to content

Commit f07e0d6

Browse files
authored
chore: rm eslint-disable (#728)
* chore: rm eslint-disable * chore: rm eslint-disable * update
1 parent 920d216 commit f07e0d6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/hooks/useEvent.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
/* eslint-disable @typescript-eslint/ban-types */
2-
/* eslint-disable react-hooks/exhaustive-deps */
31
import * as React from 'react';
42

5-
function useEvent<T extends ((...args: any[]) => any) | undefined>(
3+
const useEvent = <T extends ((...args: any[]) => any) | undefined>(
64
callback: T,
75
): undefined extends T
86
? (
97
...args: Parameters<NonNullable<T>>
108
) => ReturnType<NonNullable<T>> | undefined
11-
: T {
9+
: T => {
1210
const fnRef = React.useRef<T | undefined>(callback);
1311
fnRef.current = callback;
1412

@@ -18,6 +16,6 @@ function useEvent<T extends ((...args: any[]) => any) | undefined>(
1816
);
1917

2018
return memoFn;
21-
}
19+
};
2220

2321
export default useEvent;

0 commit comments

Comments
 (0)