Skip to content

Commit

Permalink
chore(npm): add missing tslint dependency and fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultboursier committed May 8, 2020
1 parent 8905cee commit 8c44572
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 2 deletions.
98 changes: 98 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"react": "^16.12.0",
"react-dom": "^16.12.0",
"ts-jest": "^24.2.0",
"tslint": "^6.1.2",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.7.3"
},
Expand Down
6 changes: 4 additions & 2 deletions src/useTimer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ export const useTimer = ({

if (isRunning) {
intervalId = setInterval(() => {
setTime(time =>
timerType === 'DECREMENTAL' ? time - step : time + step
setTime(previousTime =>
timerType === 'DECREMENTAL'
? previousTime - step
: previousTime + step
);
}, interval);
} else if (intervalId) {
Expand Down

0 comments on commit 8c44572

Please sign in to comment.