onDisconnected( )


Adds an event handler that runs when a disconnection occurs.

A disconnection can occur, for example, if there is a network issue.

Method Declaration
Copy
function onDisconnected(handler: function): void;
Method Parameters
handlerfunctionRequired

handler(): void The name of the function or the function expression to run when a disconnection occurs.

Add a connection handler
JavaScript
import wixRealtimeFrontend from "wix-realtime-frontend"; // ... wixRealtimeFrontend.onDisconnected(() => { // handle disconnection $w("#disconnectedMessage").show(); });
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?