Skip to content

Function: safeTerminateWs() ​

ts
function safeTerminateWs(ws?: any, fallbackToClose?: boolean): boolean;

Call terminate() when the socket provides it. Otherwise, call close() only when fallbackToClose is true, including in browsers. Returns true only when terminate() was called; returns false for the fallback or a missing socket.

Parameters ​

ParameterType
ws?any
fallbackToClose?boolean

Returns ​

boolean

Built by Siebly. Open source SDKs for exchange APIs.