Skip to content

Commit 87e2ffb

Browse files
authored
Merge pull request #98 from kilokeith/master
fix: Fix type for time returns; should have a `totalSeconds` property…
2 parents 46aad20 + e8e8fef commit 87e2ffb

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "react-timer-hook",
3-
"version": "3.0.6",
3+
"version": "3.0.7",
44
"description": "React timer hook is a custom react hook built to handle timers(countdown), stopwatch and time logic/state in your react component.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"scripts": {
8+
"prepare": "npm run build:prod",
89
"build:demo": "rm -rf ./docs && webpack --config webpack.dev.js && webpack-dev-server --open --config webpack.dev.js",
910
"build:prod": "rm -rf ./dist && webpack --config webpack.prod.js",
1011
"lint": "node_modules/.bin/eslint src"

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { useTimer } from 'react-timer-hook';
2424

2525
function MyTimer({ expiryTimestamp }) {
2626
const {
27+
totalSeconds,
2728
seconds,
2829
minutes,
2930
hours,
@@ -105,6 +106,7 @@ import { useStopwatch } from 'react-timer-hook';
105106

106107
function MyStopwatch() {
107108
const {
109+
totalSeconds,
108110
seconds,
109111
minutes,
110112
hours,

src/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ interface TimerSettings {
55
}
66

77
interface TimerResult {
8+
totalSeconds: number;
89
seconds: number;
910
minutes: number;
1011
hours: number;
@@ -24,6 +25,7 @@ interface StopwatchSettings {
2425
}
2526

2627
interface StopwatchResult {
28+
totalSeconds: number;
2729
seconds: number;
2830
minutes: number;
2931
hours: number;

0 commit comments

Comments
 (0)