on()
Adds a callback function to execute after a specific event is emitted.
Syntax
on(event, callback)
Parameters
event
A case-sensitive string
to define a callback for.
callback
The function
to call when the event happens.
Events
Event Name | Description |
---|---|
open | Emitted when Solvvy is opened |
close | Emitted when Solvvy is closed |
show | Emitted when Solvvy is shown |
hide | Emitted when Solvvy is hidden |
contact_support | Emitted when support is contacted |
send_message | Emitted when a message is sent |
Event Emit Demo
All the above events when emitted will be logged in the console below.
Example
Solvvy.on('open', () => {
console.log('solvvy opened');
});