Mlem icon indicating copy to clipboard operation
Mlem copied to clipboard

Add abstraction for upvoting/downvoting "in advance"

Open ShadowJonathan opened this issue 1 year ago • 1 comments

Inspired by https://github.com/buresdv/Mlem/issues/115, I'd like for there to be a struct that'll hold the "actual count" together with the "virtual count", the "virtual" count being updated with user action, and then it kicking off a process to update the API to reflect this status.

This way, we don't need to fiddle with the API response to mock/trick the frontend into thinking it is the actual class, and also have a struct that will automatically debounce/adjust the voting status according to the user selection, and update the "upvoted" state back to the previous one when it fails, cascading through to the frontend.

ShadowJonathan avatar Jun 12 '23 09:06 ShadowJonathan