interface ConnectionInterface {
    connectionStore: Store<ConnectionState>;
    userInfo: undefined | UserInfo;
    disconnect(): void;
    reconnect(): Promise<void>;
    start(token: undefined | string): Promise<boolean>;
}

Implemented by

Properties

connectionStore: Store<ConnectionState>

The store that tracks the connection state (disconnected, autoreconnecting, tries to connect).

userInfo: undefined | UserInfo

Information about the current user.

Methods

  • Reconnects the client to the server and reinitializes the game room state.

    Returns Promise<void>

  • Starts the client by connecting to the server and authorizing the user.

    Parameters

    • token: undefined | string

      The authorization token for the user.

    Returns Promise<boolean>

    A promise that resolves to true if the client started successfully, otherwise false.