Methods
(async) onReady(callback) → {Undefined}
Register a callback to invoked when the Agent is ready
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
The function to call when the Agent is ready |
Throws:
Example
import Agent from '@meldcx/agent'
// or
const Agent = require('@meldcx/agent');
const agent = new Agent();
agent.onReady(() => console.log('The Agent is ready'));
(async) onReadyAsync() → {Promise.<Agent>}
Wait for the agent to be ready using a Promise, this enables the onReady function to be used with async/await