property WSContextValue.castVote

Upvotes a dump at once and sends vote_cast. The server's answer confirms or reverts it, and so does a timeout of 5 s, which covers a closed socket. shownCount is the count on screen, used when voteCounts has none yet. Does nothing when the user already voted.

Type

(
dumpId: string,
shownCount?: number
) => void

Usage

import { type WSContextValue } from "src/contexts/ws/WSContext.ts";