Skip to main content
Version: v10.0.0

defaultShouldReconnect

The default of shouldReconnect : a normal closure (1000) means the server finished on purpose, so the socket stays closed until connect() or reconnect() . Every other loss - another close code, an error, a timeout - is retried.


Import
import { defaultShouldReconnect } from "@hyper-fetch/sockets"

Parameters​

defaultShouldReconnect(loss: ConnectionLossType)
Parameters
NameTypeDescription
loss
ConnectionLossType

Returns​

boolean