Home > sip.js > Emitter > addListener
Sets up a function that will be called whenever the target changes.
Signature:
addListener(listener: (data: T) => void, options?: {
once?: boolean;
}): void;
Parameter | Type | Description |
---|---|---|
listener | (data: T) => void | Callback function. |
options | { once?: boolean; } | An options object that specifies characteristics about the listener. If once true, indicates that the listener should be invoked at most once after being added. If once true, the listener would be automatically removed when invoked. |
Returns:
void