sylfort / cats-n-cheese

https://cats-n-cheese.vercel.app
2 stars 2 forks source link

Updating player #4

Open merhmood opened 5 days ago

merhmood commented 5 days ago

https://github.com/sylfort/cats-n-cheese/blob/00853bdb62bee85bb9e8b848199d2a87d0b706fe/src/utils/player.js#L12

Suggestion Take out the points from the player class and implement them as it was done in zaid-branch then trigger state update when the add points method is called like this addpoints(setState){ //state changing logic }, this will separate the concerns of the player algorithms from the data rendering algorithm which react already provides

dominic-source commented 5 days ago

Thanks.

merhmood commented 5 days ago

Sure anytime 👍🏾