use-timer icon indicating copy to clipboard operation
use-timer copied to clipboard

Timer callbacks

Open dancheskus opened this issue 4 years ago • 0 comments

onTimeUpdate wrong triggering time

onTimeUpdate function is called on component mount. I think it should be called ONLY when timer status is 'RUNNING'. Otherwise there should be some checks like:

onTimeUpdate: () => {
  if (timerName.status === 'STOPPED') return;

  ...code
},

Good callback fn to add

  1. onTimeReset
  2. onTimePause
  3. onTimeStop
  4. onTimeStart

dancheskus avatar Nov 03 '20 19:11 dancheskus