new Client(config)
Instantiate an elarian client. You have to call connect() on then client to start using it
Parameters:
Name | Type | Description |
---|---|---|
config |
ClientConfig |
Methods
connect() → {Elarian}
Connecto to elarian servers
Returns:
this instance
- Type
- Elarian
disconnect()
Disconnect from the elarian server
isConnected() → {boolean}
Check if client is connected
Returns:
- Type
- boolean
on(event, handler) → {Client}
Register a listener to watch out for events. Can also be called with client.registerListerner(event,listener)
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The event whose listener to register |
handler |
NotificationHandler | A function that reacts to events |
Returns:
this instance
- Type
- Client
registerNotificationHandler(event, handler) → {Client}
Register a listener to watch out for events. Can also be called with client.on(event,listener)
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The event whose listener to register |
handler |
NotificationHandler | A function that reacts to events |
Returns:
this instance
- Type
- Client