Skip to main content
Version: v10.0.0

ReconnectingConnectionType


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

Preview​

type ReconnectingConnectionType = {
connect: () => Promise<boolean>;
disconnect: () => Promise<boolean>;
dispose: () => void;
reconnect: () => Promise<void>;
}

Structure​

ReconnectingConnectionType
NameTypeDescription
connect
() => Promise<boolean>

Connects now - skipping a pending reconnection delay. Resolves with true once the connection is ready.

disconnect
() => Promise<boolean>

Closes the connection on purpose. It stays closed until connect() or reconnect() is called.

dispose
() => void

Removes the app manager listeners and the timers. The connection itself is closed with disconnect() .

reconnect
() => Promise<void>

Replaces the connection with a new one, also after disconnect() . Counts as a reconnection attempt.