Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
10bff069c1 | |||
8f6272eca4 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smarttime",
|
"name": "@pushrocks/smarttime",
|
||||||
"version": "3.0.3",
|
"version": "3.0.4",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smarttime",
|
"name": "@pushrocks/smarttime",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "3.0.3",
|
"version": "3.0.4",
|
||||||
"description": "handle timeformats in smart ways",
|
"description": "handle timeformats in smart ways",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
@ -15,4 +15,12 @@ tap.test('should start timer', async () => {
|
|||||||
await testTimer.completed;
|
await testTimer.completed;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tap.test('should reset a timer', async () => {
|
||||||
|
testTimer.reset();
|
||||||
|
testTimer.start();
|
||||||
|
testTimer.reset();
|
||||||
|
testTimer.start();
|
||||||
|
await testTimer.completed;
|
||||||
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -62,6 +62,7 @@ export class Timer {
|
|||||||
|
|
||||||
public pause() {
|
public pause() {
|
||||||
clearTimeout(this.currentTimeout);
|
clearTimeout(this.currentTimeout);
|
||||||
|
this.currentTimeout = null;
|
||||||
this.pausedAt = TimeStamp.fromTimeStamp(this.startedAt);
|
this.pausedAt = TimeStamp.fromTimeStamp(this.startedAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user