Namespace: LiveView

LiveView

Classes

AlertRule
Connection
Error
Field
Query
QuerySubscription
Schema
Table
Tuple

Methods

staticLiveView.closeAllConnections(settings){Promise.<void>}

Closes all currently active LiveView connections
Name Type Description
settings Object Object containing the settings for performing the connection
Name Type Description
context Object optional Object to use as the context for all callback functions. Use this if you need the callbacks to execute within a specific context or scope other than the global window.
onSuccess function optional Callback function to invoke upon successful closure of all connections. The callback function will not be passed any parameters.
onError function optional Callback function to invoke upon failure to close all connections. The callback function will be passed an Error object containing details about what went wrong.
Returns:
Promise to close all connections. Resolves upon clean closure of all connections. If the connection fails, the promise will be rejected and the rejection handler will be passed an Error object with details about what went wrong.

staticLiveView.connect(settings){Promise.<LiveView.Connection>}

Connects to the LiveView server identified by the settings.url parameter.
Name Type Description
settings Object Object containing the settings for performing the connection
Name Type Description
url String optional The URL of the LiveView server to connect to. The format of the url should be of the form: http://hostname:port/path/to/lv/client or /path/to/lv/client. For example: http://localhost:10080/lv/client or /lv/client. If a pathname is given as the URL, the API will attempt to connect to the host identified by the current window location. If no url is specified, the API will attempt to use '/lv/client'.
username String optional The username to use when authenticating with the LiveView server.
password String optional The password to use when authenticating with the LiveView server.
onClose function optional Callback function to invoke upon closure of the connection (whether in error or as expected). The callback will be passed an object containing two or three fields: connection, actor, and (optionally) error. The connection field will be the Connection that was closed. The actor field will either be "client" or "server" depending on whether the client or server initiated the closing of the connection. The error field (if set) is an Error. The presence of the error field indicates an error took place and the connection was closed as a result.
context Object optional Object to use as the context for all callback functions. Use this if you need the callbacks to execute within a specific context or scope other than the global window.
onSuccess function optional Callback function to invoke upon successful connection to LiveView. The callback function will be passed an object containing one field: connection:Connection The new connection that was created.
onError function optional Callback function to invoke upon failure to connect to LiveView. The callback function will be passed an Error object containing details about what went wrong.
Returns:
Promise for the Connection object that represents the opened connection. If the connection fails, the promise will be rejected and the rejection handler will be passed an Error object with details about what went wrong.