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

    Return type for the usePollState hook.

    interface UsePollStateResult {
        activePolls: Poll[];
        addPoll: (poll: Poll) => void;
        clearPolls: () => void;
        endedPolls: Poll[];
        hasVoted: (pollId: string) => boolean;
        polls: Map<string, Poll>;
        recordVote: (pollId: string, optionIds: string[]) => void;
        removePoll: (id: string) => void;
        setPolls: (polls: Poll[]) => void;
        sortedPolls: Poll[];
        updatePoll: (id: string, updates: Partial<Poll>) => void;
        userVotes: Map<string, UserVote>;
    }
    Index

    Properties

    activePolls: Poll[]

    Currently active polls

    addPoll: (poll: Poll) => void

    Add a new poll

    clearPolls: () => void

    Clear all polls

    endedPolls: Poll[]

    Ended polls

    hasVoted: (pollId: string) => boolean

    Check if user has voted on poll

    polls: Map<string, Poll>

    Map of poll ID to poll

    recordVote: (pollId: string, optionIds: string[]) => void

    Record user's vote

    removePoll: (id: string) => void

    Remove a poll

    setPolls: (polls: Poll[]) => void

    Set all polls

    sortedPolls: Poll[]

    Polls sorted by creation time (newest first)

    updatePoll: (id: string, updates: Partial<Poll>) => void

    Update an existing poll

    userVotes: Map<string, UserVote>

    User's votes (pollId -> UserVote)