Conversation
|
Hi @murtaza98 , Can you kindly review this Pull request. Thanks 😄. |
|
Hi @RahulNavneeth Firstly, thanks for the contribution. I liked your idea of sorting by votes. Any chance you could isolate that feature in a separate PR? Wrt the changing of data types of votes, I'm not sure I understood the reason y you had to do this. Can you please elaborate on this further? What was the limitation of the previous type and how this new type solves those issues |
|
Sure sir, To improve the process of vote manipulation and avoid bottlenecks - instead of only manipulating the votes, merging the votes and options as a single entity can be a viable solution. This way, each vote will have its own options and votes method, which can result in a more efficient and streamlined process. Screen.Recording.2023-03-09.at.7.22.17.PM.movAs seen in the example provided, this approach allows manipulation and sorting only for the votes without modifying the options, thus arriving at potential bottlenecks. BEFORE:Sorts only the votes WORKAROUNDLot of boilerplate AFTER:The vote sorting process is done comprehensively with both the votes and options altogether |
|
Sir, as requested I have isolated the sorting feature in a separate PR #23 . |



Sorting the options by vote quantity
Changes that are made:
In IPoll interface.
Instead of separate options and vote datatype - combined both as data.
Before:
options: Array<string>votes: Array<IVoter>After:
data: Array<{option: string, votes: Array<IVoter>}>Advantage: Can be accessed easily.
Sorted the options with the highest votes at the top.
Before:
BEFORE.mp4
After:
AFTER.mp4
Fixes #19