File tree Expand file tree Collapse file tree 2 files changed +1432
-1836
lines changed Expand file tree Collapse file tree 2 files changed +1432
-1836
lines changed Original file line number Diff line number Diff line change 1- import { useMemo , useRef } from 'react'
1+ import { MutableRefObject , useMemo , useRef } from 'react'
22import useMounted from './useMounted'
33import useWillUnmount from './useWillUnmount'
44
@@ -12,7 +12,11 @@ import useWillUnmount from './useWillUnmount'
1212 */
1313const MAX_DELAY_MS = 2 ** 31 - 1
1414
15- function setChainedTimeout ( handleRef , fn , timeoutAtMs ) {
15+ function setChainedTimeout (
16+ handleRef : MutableRefObject < any > ,
17+ fn : ( ) => void ,
18+ timeoutAtMs : number ,
19+ ) {
1620 const delayMs = timeoutAtMs - Date . now ( )
1721
1822 handleRef . current =
@@ -50,7 +54,6 @@ export default function useTimeout() {
5054 } else {
5155 setChainedTimeout ( handleRef , fn , Date . now ( ) + delayMs )
5256 }
53-
5457 }
5558
5659 return {
You can’t perform that action at this time.
0 commit comments