with Vote State
Creates a copy of this item with updated vote state.
Useful for performing optimistic UI updates before network confirmation and reconciling server state after FeedbackClient.toggleVote.
Return
An updated FeatureRequestItem instance.
Example:
val optimistic = item.withVoteState(voted = true, count = item.voteCount + 1)Content copied to clipboard
Parameters
voted
Whether the user has voted.
count
The new total vote count.