Interface UseVoteReturn

The return type for the useVote hook.

Hierarchy

  • UseVoteReturn

Properties

cancelVote: ((submissionId?) => Promise<void>)

Type declaration

    • (submissionId?): Promise<void>
    • Cancels the current vote for a given submission. Defaults to the provided submissionId in the hook.

      Parameters

      • Optional submissionId: string

      Returns Promise<void>

downVote: ((submissionId?) => Promise<void>)

Type declaration

    • (submissionId?): Promise<void>
    • Registers a downvote for a given submission. Defaults to the provided submissionId in the hook.

      Parameters

      • Optional submissionId: string

      Returns Promise<void>

fetched: boolean

A boolean flag indicating whether the vote status has been fetched.

myVote: number

Represents the current user's vote value. Possible values are:

  • 1 for an upvote,
  • -1 for a downvote,
  • 0 for no vote.
upVote: ((submissionId?) => Promise<void>)

Type declaration

    • (submissionId?): Promise<void>
    • Registers an upvote for a given submission. Defaults to the provided submissionId in the hook.

      Parameters

      • Optional submissionId: string

      Returns Promise<void>

voteBalance: number

Represents the total vote balance (sum of all votes) for the submission.

Generated using TypeDoc