Home Reference Source

Function

Static Public Summary
public

createTypingDetector(conversation: Conversation, options: Object): function

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

Static Public

public createTypingDetector(conversation: Conversation, options: Object): function source

import {createTypingDetector} from 'skygear-chat/lib/utils.js'

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:

function

Example:

<script>
 var typing = createTypingDetector(conversation);
</script>
<input type=text oninput="typing()" />