You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-timer-hook

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-timer-hook - npm Package Compare versions

Comparing version

to
3.0.5

8

dist/index.d.ts
interface TimerSettings {
autoStart?: boolean;
expiryTimestamp: number;
expiryTimestamp: Date;
onExpire?: () => void;

@@ -16,3 +16,3 @@ }

resume: () => void;
restart: (newExpiryTimestamp: number, autoStart?: boolean) => void;
restart: (newExpiryTimestamp: Date, autoStart?: boolean) => void;
}

@@ -24,3 +24,3 @@

autoStart?: boolean;
offsetTimestamp?: number;
offsetTimestamp?: Date;
}

@@ -36,3 +36,3 @@

pause: () => void;
reset: (offsetTimestamp?: number, autoStart?: boolean) => void;
reset: (offsetTimestamp?: Date, autoStart?: boolean) => void;
}

@@ -39,0 +39,0 @@

{
"name": "react-timer-hook",
"version": "3.0.4",
"version": "3.0.5",
"description": "React timer hook is a custom react hook built to handle timers(countdown), stopwatch and time logic/state in your react component.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -75,3 +75,3 @@ ## react-timer-hook

| --- | --- | --- | ---- |
| expiryTimestamp | number(timestamp) | YES | this will define for how long the timer will be running |
| expiryTimestamp | Date object | YES | this will define for how long the timer will be running |
| autoStart | boolean | No | flag to decide if timer should start automatically, by default it is set to `true` |

@@ -93,3 +93,3 @@ | onExpire | Function | No | callback function to be executed once countdown timer is expired |

| resume | function | function if called after pause the timer will continue countdown from last paused state |
| restart | function | function to restart timer with new expiryTimestamp, accept 2 arguments first is the new `expiryTimestamp` of type number(timestamp) and second is `autoStart` of type boolean to decide if it should automatically start after restart or not, default is `true` |
| restart | function | function to restart timer with new expiryTimestamp, accept 2 arguments first is the new `expiryTimestamp` of type Date object and second is `autoStart` of type boolean to decide if it should automatically start after restart or not, default is `true` |

@@ -149,3 +149,3 @@

| autoStart | boolean | No | if set to `true` stopwatch will auto start, by default it is set to `false` |
| offsetTimestamp | number | No | this will define the initial stopwatch offset example: `const stopwatchOffset = new Date(); stopwatchOffset.setSeconds(stopwatchOffset.getSeconds() + 300);` this will result in a 5 minutes offset and stopwatch will start from 0:0:5:0 instead of 0:0:0:0 |
| offsetTimestamp | Date object | No | this will define the initial stopwatch offset example: `const stopwatchOffset = new Date(); stopwatchOffset.setSeconds(stopwatchOffset.getSeconds() + 300);` this will result in a 5 minutes offset and stopwatch will start from 0:0:5:0 instead of 0:0:0:0 |

@@ -152,0 +152,0 @@ ### Values