Skip to content

Commit

Permalink
main 🧊 fix use stopwatch
Browse files Browse the repository at this point in the history
  • Loading branch information
debabin committed Jun 30, 2024
1 parent a3d8be5 commit cee1172
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/hooks/useStopwatch/useStopwatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ type UseStopwatch = {
* @description - Hook that creates a stopwatch functionality
*
* @overload
* @param {number} [initialTime=0] - The initial time of the timer
* @param {boolean} [options.enabled=true] - The enabled state of the timer
* @param {number} [initialTime=0] The initial time of the timer
* @param {boolean} [options.enabled=true] The enabled state of the timer
* @returns {UseStopwatchReturn} An object containing the current time and functions to interact with the timer
*
* @example
* const { seconds, minutes, start, pause, reset } = useStopwatch(1000, { enabled: false });
*
* @overload
* @param {number} [options.initialTime=0] - The initial time of the timer
* @param {boolean} [options.enabled=true] - The enabled state of the timer
* @param {number} [options.initialTime=0] -The initial time of the timer
* @param {boolean} [options.enabled=true] The enabled state of the timer
* @returns {UseStopwatchReturn} An object containing the current time and functions to interact with the timer
*
* @example
Expand All @@ -80,7 +80,7 @@ export const useStopwatch = ((...params: any[]) => {
const initialTime =
(typeof params[0] === 'number'
? (params[0] as number | undefined)
: (params[0] as UseStopwatchOptions & { initialTime?: number }).initialTime) ?? 0;
: (params[0] as UseStopwatchOptions & { initialTime?: number })?.initialTime) ?? 0;

const options =
typeof params[0] === 'number'
Expand Down

0 comments on commit cee1172

Please sign in to comment.