amrlabib / react-timer-hook

React timer hook
https://www.npmjs.com/package/react-timer-hook
MIT License
515 stars 112 forks source link

How to stop the timer from outside of the timer component and how to get to the duration when stopped? #49

Closed karland closed 3 years ago

karland commented 3 years ago

Hi, is there any possibility to stop the timer from outside of the timer component and then to get to the duration when the stop was performed? Thanks a lot.

amrlabib commented 3 years ago

Hi, useTimer is returning pause function , it can be used to pause the timer. regarding duration the timer will always return all time attributes include seconds, minutes, hours and they should reflect the correct values even when the timer is paused. hope this answers your question

karland commented 3 years ago

Yes, it does. Thank you very much.