new Elarian(config)
Instantiate an elarian client. You have to call connect() on the client to start using it
Parameters:
Name | Type | Description |
---|---|---|
config |
ClientConfig |
- Source:
Extends
Methods
connect() → {Elarian}
Connecto to elarian servers
- Inherited From:
- Source:
Returns:
this instance
- Type
- Elarian
disconnect()
Disconnect from the elarian server
- Inherited From:
- Source:
fetchAppState() → {AppState}
Lease app state
- Source:
Returns:
- Type
- AppState
isConnected() → {boolean}
Check if client is connected
- Inherited From:
- Source:
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 |
- Inherited From:
- Source:
Returns:
this instance
- Type
- Client
updateAppState(data) → {AppState}
Update app state
Parameters:
Name | Type | Description |
---|---|---|
data |
Buffer |
- Source:
Returns:
- Type
- AppState