JavaScript
1
Вклад в тег
const end = () => {
alert('end');
}
const step = () => {
if( state.timeleft.seconds-1 < 0 ){
if( state.timeleft.minutes !== 0 ){
state.timeleft.seconds = 59;
state.timeleft.minutes = ( state.timeleft.minutes-1 < 0) ? 0 : state.timeleft.minutes-1;
} else {
clearInterval( state.timerId );
end();
}
} else {
state.timeleft.seconds--;
}
render();
}