Search...
onDisconnected( )
Adds an event handler that runs when a disconnection occurs.
Description
A disconnection can occur, for example, if there is a network issue.
Syntax
function onDisconnected(handler: DisconnectionHandler): voidhandler: function DisconnectionHandler(): void
onDisconnected Parameters
NAME
TYPE
DESCRIPTION
handler
The name of the function or the function expression to run when a disconnection occurs.
Returns
This function does not return anything.
Return Type:
void
DisconnectionHandler Parameters
This function does not take any parameters.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
Add a connection handler
Copy Code
1import wixRealtime from 'wix-realtime';23// ...45wixRealtime.onDisconnected( () => {6 // handle disconnection7 $w("#disconnectedMessage").show();8} );