Methods
(async, static) hook(name, …context, …data) → {Promise.<any>}
Triggers a hook which can be intercepted by registered listeners via _converse.api.listen.on or _converse.api.listen.once. (see _converse.api.listen). A hook is a special kind of event which allows you to intercept a data structure in order to modify it, before passing it back.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | The hook name |
|
context |
any |
<repeatable> |
The context to which the hook applies (could be for example, a _converse.ChatBox)). |
data |
any |
<repeatable> |
The data structure to be intercepted and modified by the hook listeners. |
- Source:
Returns:
- A promise that resolves with the modified data structure.
- Type
- Promise.<any>