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

    What useDeck returns.

    interface UseDeckResult {
        answer: (answer: GameAnswer, keepOpen?: boolean) => boolean;
        finish: () => void;
        finished: boolean;
        index: number;
        next: () => void;
        record: DeckRecord | null;
        restart: () => void;
        round: DeckRound<GameCard> | null;
        state: DeckState | null;
        summary: DeckSummary;
        total: number;
    }
    Index

    Properties

    answer: (answer: GameAnswer, keepOpen?: boolean) => boolean

    Answer the round; whether it was right. keepOpen overrides keepOpenWhenWrong for this answer (false settles a wrong answer)

    finish: () => void

    End the deck where it stands

    finished: boolean
    index: number

    The round's place, from 0

    next: () => void

    Move on to the next round once settled

    record: DeckRecord | null

    The deck kept small, to store

    restart: () => void

    The same deck again from the start

    round: DeckRound<GameCard> | null

    The round being played, or null once the deck is finished or when it could not be made

    state: DeckState | null

    The whole deck, or null when it could not be made

    summary: DeckSummary
    total: number

    Rounds in the deck