Skip to content

Commit 88a3965

Browse files
📝 Update docs and changelog.
1 parent 5997810 commit 88a3965

3 files changed

Lines changed: 31 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# Changelog
22

3+
### 5.4.0
4+
5+
#### ⚡️ Features
6+
- Expose `IIdleTimer` interface as the second parameter to callback methods. #339
7+
8+
#### 🐞 Bug Fixes
9+
- Prevent race condition error from being thrown when the hook unmounts while using leader election. #337
10+
311
### 5.3.3
412

513
#### 🐞 Bug Fixes
614
- Fix a bug where `onPrompt` would be emitted instead of `onIdle` after `timeout` is exceeded when devices wake from sleep. #172
7-
- Fix a bug where `onMessage` was being called with old function reference. #328
15+
- Fix a bug where `onMessage` was being called with an old function reference. #328
816

917
### 5.5.2
1018

docs/pages/docs/about/changelog.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
title: Changelog
33
description: IdleTimer Changelog
44
---
5+
### 5.4.0
6+
<Divider />
7+
8+
#### ⚡️ Features
9+
- Expose `IIdleTimer` interface as the second parameter to callback methods.
10+
11+
#### 🐞 Bug Fixes
12+
- Prevent race condition error from being thrown when the hook unmounts while using leader election.
13+
514
### 5.5.3
615
<Divider />
716

docs/pages/docs/api/props.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ set of properties. Examples of how they are used can be found in the
6363

6464
### onPresenceChange
6565
<Property
66-
description='Function to call when the users presence state changes. This provides a single function to handle all state changes.'
67-
type='(presence: PresenceType) => void'
66+
description="Function to call when the user's presence state changes. This provides a single function to handle all state changes."
67+
type='(presence: PresenceType, idleTimer?: IIdleTimer) => void'
6868
defaultValue='() => {}'
6969
>
7070
```ts
@@ -86,56 +86,56 @@ set of properties. Examples of how they are used can be found in the
8686

8787
### onPrompt
8888
<Property
89-
description='When `promptTimeout` is set, this function is called after the user becomes idle. This is useful for displaying a confirm prompt. If the prompt timeout is reached, `onIdle` is then called.'
90-
type='() => void'
89+
description='When `promptTimeout` is set, this function is called after the user becomes idle. This is useful for displaying a confirmation prompt. If the prompt timeout is reached, `onIdle` is then called.'
90+
type='(event?: Event, idleTimer?: IIdleTimer) => void'
9191
defaultValue='() => {}'
9292
/>
9393

9494
### onIdle
9595
<Property
96-
description='Function to call when user is idle.'
97-
type='() => void'
96+
description='Function to call when the user is idle.'
97+
type='(event?: Event, idleTimer?: IIdleTimer) => void'
9898
defaultValue='() => {}'
9999
/>
100100

101101
### onActive
102102
<Property
103-
description='Function to call when user becomes active.'
104-
type='(event: Event) => void'
103+
description='Function to call when the user becomes active.'
104+
type='(event?: Event, idleTimer?: IIdleTimer) => void'
105105
defaultValue='() => {}'
106106
/>
107107

108108
### onMessage
109109
<Property
110110
description='Function to call when a `message` event is received.'
111-
type='(data: string | number | object) => void'
111+
type='(data: any, idleTimer?: IIdleTimer) => void'
112112
defaultValue='() => {}'
113113
/>
114114

115115
### onAction
116116
<Property
117117
description='Function to call on user activity.'
118-
type='(event: Event) => void'
118+
type='(event?: Event, idleTimer?: IIdleTimer) => void'
119119
defaultValue='() => {}'
120120
/>
121121

122122
### debounce
123123
<Property
124-
description='Debounce the onAction function by setting delay in milliseconds.'
124+
description='Debounce the `onAction` function by setting delay in milliseconds.'
125125
type='number'
126126
defaultValue='0'
127127
/>
128128

129129
### throttle
130130
<Property
131-
description='Throttle the onAction function by setting delay in milliseconds.'
131+
description='Throttle the `onAction` function by setting delay in milliseconds.'
132132
type='number'
133133
defaultValue='0'
134134
/>
135135

136136
### eventsThrottle
137137
<Property
138-
description='Throttle the activity events. Useful if you are listening to mouse events. Helps to cut down on cpu usage.'
138+
description='Throttle the activity events. Useful if you are listening to mouse events. Helps to cut down on CPU usage.'
139139
type='number'
140140
defaultValue='200'
141141
/>

0 commit comments

Comments
 (0)