chat-engine-typing-indicator

Emits the $typingIndicator.startTyping and ``$typingIndicator.stopTyping``` even on a Chat when a user is marked as typing or not typing.

require('chat-engine-typing-indicator')(configopt)

Source:
Example
//providing a config is optional, the default timeout is 1000ms
let config = { timeout: 1000 }
chat.plugin(ChatEngineCore.plugin['chat-engine-typing-indicator'](config));

// emit the typing event
chat.typingIndicator.startTyping();

// manually emit the stop tying event
// this is automagically emitted after the timeout period, or when a message is sent
chat.typingIndicator.stopTyping();

// typing boolean
chat.isTyping;
// False

chat.on('$typingIndicator.startTyping', (payload) => {
    console.log(payload.user, "is typing...");
});

chat.on('$typingIndicator.stopTyping', (payload) => {
        (payload.user, "is not typing.");
});
Parameters:
Name Type Attributes Description
config Object <optional>

The plugin config object

Properties
Name Type Attributes Description
timeout Integer <optional>

Fires the "stopTyping" event if have not typed within this setting. Milliseconds.

Source:

Requires

Methods

(inner) typingindicator.startTyping()

Augments:
Source:

emit an event over the network that this user started typing

(inner) typingindicator.stopTyping()

Augments:
Source:

Events

$typingIndiciator.stopTyping

Augments:
Source:

broadcast a stoptyping event