Skip to content

Commit 1eaf703

Browse files
committed
Update typing event and timeout parameter names, updating default for heartbeatThrottleMs
1 parent 65e6f60 commit 1eaf703

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

content/chat/rooms/typing.textile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The following is the structure of a typing event:
7373
"zoranges",
7474
},
7575
"change": {
76-
"event": "typing.started",
76+
"type": "typing.started",
7777
"clientId": "clemons"
7878
}
7979
}
@@ -84,6 +84,8 @@ The following are the properties of a typing event:
8484
|_. Property |_. Description |_. Type |
8585
| currentlyTyping | A set of all users currently typing. | Set |
8686
| change | The single change that resulted in the event. | Object |
87+
| | type: The type of change that occurred. | String |
88+
| | clientId: The @clientId@ of the user that triggered the change. | String |
8789

8890
You can use the size of the @currentlyTyping@ set to decide whether to display individual user names, or that multiple people are typing in your user interface.
8991

@@ -135,11 +137,11 @@ blang[javascript,swift,kotlin].
135137
blang[react].
136138
Use the "@start()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-react.UseTypingResponse.html#start method available from the response of the @useTyping@ hook to emit an event when a user has started typing.
137139

138-
There is a timeout associated with start events. On first calling `start()`, this timer is set, subsequent calls to `start()` before the timer expires will result in a no-op. The length of this timeout is customizable using the @heartbeatIntervalMs@ parameter that can be configured in the @RoomOptions@ that you set when you "create a room":/docs/chat/rooms#create. The default is 15000ms.
140+
There is a timeout associated with start events. On first calling `start()`, this timer is set, subsequent calls to `start()` before the timer expires will result in a no-op. The length of this timeout is customizable using the @heartbeatThrottleMs@ parameter that can be configured in the @RoomOptions@ that you set when you "create a room":/docs/chat/rooms#create. The default is 10000ms.
139141

140142
Consequently, if you want to keep the typing indicator active, you should call `start()` with each key press to ensure a new typing event is emitted after the timeout has expired.
141143

142-
For a client receiving typing events, the typing indicator they have received will remain active for the duration of the timeout, plus a predefined grace period of 2000ms. If a new typing event is received for the same user before the grace period has expired, the typing indicator will be reset to the full duration of the timeout. For example, if the timeout is 15000ms, the typing indicator will remain active for 17000ms.
144+
For a client receiving typing events, the typing indicator they have received will remain active for the duration of the timeout, plus a predefined grace period of 2000ms. If a new typing event is received for the same user before the grace period has expired, the typing indicator will be reset to the full duration of the timeout. For example, if the timeout is 15000ms, the typing indicator will remain active for 12000ms.
143145

144146
<aside data-type='note'>
145147
<p>It is important for all clients in a room to have the same timeout value set, otherwise the typing indicators may not be displayed correctly.</p>

0 commit comments

Comments
 (0)