Home Reference Source

Function

Static Public Summary
public

TypingDetector(conversation: Conversation, options: Object): *

Detects whether the user is typing in an input field and send typing events to the server.

Static Public

public TypingDetector(conversation: Conversation, options: Object): * source

import TypingDetector from 'js-chat-demo/utils/TypingDetector.jsx'

Detects whether the user is typing in an input field and send typing events to the server.

Params:

NameTypeAttributeDescription
conversation Conversation

send typing events to this conversation.

options Object
  • optional
options.debounceTime number
  • optional
  • default: 3000

interger of miliseconds to debounce calls

Return:

*

Example:

var typing = TypingDetector(conversation); // NOTE: this is not a class, don't use 'new'.
<input type=text oninput="typing()" />