Function useLuckyDraw

  • useLuckyDraw - pass all candidates, use the draw function with number of round winners to get each round winners, remain candidates and allWinners.

    • Record by localstorage for custom feature. ex: key: 'http://localhost:9000/?page=2'(location href), value: allWinners<User[][]> (This feature can only use in client side and will not clear.)

    Parameters

    • allCandidates: User[]
    • Optional willAutoDrawRemainCount: Boolean

    Returns {
        MaskDiv: FC<{}>;
        allWinners: User[][];
        candidates: User[];
        clearWinners: (() => void);
        currentRound: number;
        draw: ((roundWinnersCount) => void);
        hasDraw: Boolean;
        reset: (() => void);
        winners: User[];
    }

    • MaskDiv: FC<{}>
    • allWinners: User[][]
    • candidates: User[]
    • clearWinners: (() => void)
        • (): void
        • Returns void

    • currentRound: number
    • draw: ((roundWinnersCount) => void)
        • (roundWinnersCount): void
        • Parameters

          • roundWinnersCount: number

          Returns void

    • hasDraw: Boolean
    • reset: (() => void)
        • (): void
        • Returns void

    • winners: User[]

Generated using TypeDoc