This is the constructor for the Library Object. Note that the constructor is also being
attached to the context that the library was loaded in.
Properties:
| Name | Type | Description |
|---|---|---|
callbacks |
object | Internal map of registered callback functions |
_requests |
array | Internal map of requests by message id, private property. |
_queuedMsgs |
array | Array of pending messages to be sent when socket reconnected |
_isReconnect |
boolean | Whether or not we are doing a reconnect for the socket |
- Source:
Example
var Lib = new AgentLibrary({
authHost:'d01-test.cf.dev:8080', // window.location.origin
testingLocal: true,
allowMultiSocket: true,
callbacks: {
closeResponse: onCloseFunction,
openResponse: onOpenFunction
}
});
Namespaces
Methods
(static) AgentLibrary#getCallback() → {object}
Get a given registered callback by type
- Source:
Returns:
- Type
- object
(static) AgentLibrary#getCallbacks() → {array}
Get the map of all registered callbacks
- Source:
Returns:
- Type
- array
(static) AgentLibrary#getSocket() → {object}
Get the socket connection to IntelliSocket
- Source:
Returns:
- Type
- object
(static) AgentLibrary#setCallback(type, callback)
Set an individual callback function for the given type
Parameters:
| Name | Type | Description |
|---|---|---|
type |
string | The name of the event that fires the callback function |
callback |
function | The function to call for the given type |
- Source:
(static) AgentLibrary#setCallbacks(callbackMap)
Set multiple callback functions based on type
Parameters:
| Name | Type | Description |
|---|---|---|
callbackMap |
Object | Contains map of callback types to their respective functions: callbackMap = { closeResponse: onCloseFunction, openResponse: onOpenFunction } Possible callback types: |
- Source: