♻️ Refactored the codebase to be more awesome! 🐢#3
♻️ Refactored the codebase to be more awesome! 🐢#3heypoom wants to merge 14 commits intopariyathida:masterfrom
Conversation
|
เยอะจัง เดี๋ยวพรุ่งนี้มาตรวจนะ |
|
โอ๊ะ ลืมไปว่า Refactor ไปจนไม่ต้อง Pass Props หลายชั้นแล้วแฮะ ไม่ต้องใช้ Context แล้ว~ แก้แปปนะครับ 55 |
|
ขอบคุณนะคะ ^^ |
|
แก้ไข Merge Conflict ให้แล้วครับ |
| } catch (err) { | ||
| console.warn('The previous high score cannot be retrieved:', err.message) | ||
| } | ||
| } |
There was a problem hiding this comment.
Where this function used?
If unused please delete it.
There was a problem hiding this comment.
This warning message will be triggered when the AsyncStorage throws an error. It is still in use.
There was a problem hiding this comment.
Also, componentDidMount is a component lifecycle method which will be invoked by React during runtime.
| const highScore = await AsyncStorage.getItem(HIGH_SCORE_KEY) | ||
|
|
||
| if (highScore) { | ||
| console.log('Retrieved Previous High Score:', highScore) |
There was a problem hiding this comment.
This could be Retrieved current high score, right?
Because this state haven't been record the new high score.
There was a problem hiding this comment.
Good point! I'll update the log message.
|
just here to say hi, I'm from the future |
First of all, I'm sorry for such a large pull request. I originally intended to make a couple of minor refactorings here and there, but I got carried away.
So, this is a fairly major refactoring attempt with quite a lot of alterations. Here are the changes I have made to make the codebase a bit more readable:
Thank you for such a fun little game!