Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/content/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,13 @@ Argument is optional and defaults to the lock expiration time.

### `getRemainingTime`

Get the remaining time before the lock expires.
Get the remaining time in milliseconds before the lock expires.

```ts
const lock = verrou.createLock('key', '10s')
await lock.acquire()

// returns remaining time for the lock in milliseconds
const remainingTime = lock.getRemainingTime()
```

Expand Down
2 changes: 1 addition & 1 deletion packages/verrou/src/lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class Lock {
}

/**
* Get the remaining time before the lock expires
* Get the remaining time in milliseconds before the lock expires
*/
getRemainingTime() {
if (this.#expirationTime === null) return null
Expand Down