Skip to main content
An event emitter that reports reconnection state changes.

Methods

on(event, callback)

Listen for state change events.

Callback data

State values

Disconnect reasons

When status is "disconnected", the reason field may contain:

Reconnection behavior

Auto-reconnection triggers only on WebSocket close codes 1005 and 1006. All other close codes display the disconnect overlay without attempting reconnection.
  • Reconnection window: 60 seconds from first disconnect
  • Retry delay: 5 seconds between attempts
  • If the window expires, state transitions to "failed" with code 4007

Next steps

Custom loading screen

Drive a loading screen from reconnection state changes.

Troubleshooting

Diagnose disconnect codes and reconnection failures.