dlcastillop/final-countdown-js

Run a function when the counter, stopwatch or timer is played

Opened this issue · 1 comments

Run a function when the counter, stopwatch or timer is played

Examples

const counter = useCountDown(0, 10, {
    startPaused: false,
    onFinish: () => console.log("Counter ended"),
    onPlay: () => console.log("Counter paused"),
});
const counter = useCountUp(0, 10, {
    startPaused: false,
    onFinish: () => console.log("Counter ended"),
    onPlay: () => console.log("Counter paused"),
});
const counter = useStopwatch({
    endTime: "00:00:00:10",
    startPaused: false,
    onFinish: () => console.log("Counter ended"),
    onPlay: () => console.log("Stopwatch paused"),
});
const counter = useTimer("00:00:00:10", {
    startPaused: false,
    onFinish: () => console.log("Counter ended"),
    onPlay: () => console.log("Timer paused"),
});