Function: safeTerminateWs()
ts
function safeTerminateWs(ws?: unknown, fallbackToClose?: boolean): boolean;Call terminate() when supported by the WebSocket implementation. Otherwise, call close() only when fallbackToClose is true. Returns true for termination and false for fallback or a missing socket.
Parameters
| Parameter | Type |
|---|---|
ws? | unknown |
fallbackToClose? | boolean |
Returns
boolean