Hiyve Components - v1.0.0
    Preparing search index...

    Interface WaitForHostState

    Wait for host state when joining a room before the host arrives.

    When a user tries to join a room that the host has not yet started, they can wait for the host to create it. The timeout field indicates how long the client will wait before giving up.

    Waiting for host screen:

    function WaitingForHostScreen() {
    const { isWaiting, roomName, timeout, elapsedTime } = useWaitForHost();

    if (!isWaiting) return null;
    const remaining = timeout ? Math.max(0, timeout - elapsedTime) : null;

    return (
    <View style={styles.center}>
    <Text>Waiting for host to start "{roomName}"</Text>
    {remaining !== null && <Text>Timeout in {remaining}s</Text>}
    </View>
    );
    }
    interface WaitForHostState {
        elapsedTime: number;
        isWaiting: boolean;
        roomName: string | null;
        timeout: number | null;
    }
    Index

    Properties

    elapsedTime: number

    Seconds elapsed since started waiting

    isWaiting: boolean

    Whether currently waiting for the host

    roomName: string | null

    Name of the room waiting for

    timeout: number | null

    Timeout in seconds, null if no timeout