Closed sheleoni closed 11 months ago
replying to https://github.com/sheleoni/icecream-kana-game/issues/69#issue-2050695291
thing is, we have to store the scoreBreakdown in the backend anyway (and retrieve it on page load) since the frontend rendering logic depends on the score breakdown (your score: XX) is dependent on scoreBreakdown
object.
If we only send the final score (number) to the backend on pass it as a prop to "your score", you will create disconnection between the scoreBreakdown and the total score, which makes for a very confusing UX
So, let's go forward and store the scoreBreakdown
as it is on the backend as an array of kana characters and their score. Anyway, we are going to need to fetch the scoreBreakdown
object, so I don't think it's worth in in trying to optimize data fetching by storing total score in a separate field. Unless we evolve to require only totalScore on some other routes (e.g. leaderboard that only shows users' totalscore)
Points to Consider
whether to store
totalScore
as its individual field