@@ -10,9 +10,8 @@ useTimeout(
1010 runOnMount ?: boolean
1111): {
1212 isReady: Ref < boolean | null > ;
13- isIdle : Ref < boolean > ;
14- cancel : () => void ;
1513 start : () => void ;
14+ stop : () => void ;
1615}
1716```
1817
@@ -26,10 +25,9 @@ useTimeout(
2625- ` isReady: Ref<boolean | null> ` the timer status
2726 - ` false ` when the timer is executing
2827 - ` true ` when the timer is completed
29- - ` null ` when the timer is cancelled
30- - ` isIdle: Ref<boolean> ` this value is ` true ` if the timer has ever been called, ` false ` otherwise
31- - ` cancel: Function ` the function used to cancel the timer
28+ - ` null ` when the timer is idle
3229- ` start: Function ` the function used for starting or resetting the timer
30+ - ` stop: Function ` the function used to stop the timer
3331
3432## Usage
3533
@@ -39,7 +37,7 @@ useTimeout(
3937 <p >Timer status: {{ isReady ? 'Called!' : 'Pending...' }}</p >
4038
4139 <button @click =" start" >Reset Timer</button >
42- <button @click =" cancel " >Cancel Timer</button >
40+ <button @click =" stop " >Stop Timer</button >
4341 </div >
4442</template >
4543
@@ -51,8 +49,8 @@ useTimeout(
5149 name: ' UseTimeoutDemo' ,
5250 setup () {
5351 const timerDuration = 3000
54- const { isReady , cancel , start } = useTimeout (timerDuration)
55- return { isReady, cancel, start }
52+ const { isReady , start , stop } = useTimeout (timerDuration)
53+ return { isReady, start, stop }
5654 }
5755 })
5856 </script >
0 commit comments