In order to use Jexia's realtime functionality using the Websocket protocol, you will need to create a
The Websocket constructor has one required parameter which is the URL. For further information about Websocket consult the Websocket documentation.
Creating a websocket object
In order to establish the Websocket connection, create a
Sending data to the server
Once the connection is established you can subscribe to events. Call the the
Websocket object 's
send() method in order to do this:
Receiving the response
When messages are received, a
message event is sent to the
Websocket object. In order to listen to the event, use the
onmessage event handler.
The output will be something like this. In this example the event fires when a new record is created in Dataset. For update and delete, the value of
action will change to "updated" or "deleted"
It's not possible to subscribe to a related resource