-
Notifications
You must be signed in to change notification settings - Fork 16
♻️ Refactored the codebase to be more awesome! 🐢 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where this function used?
If unused please delete it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This warning message will be triggered when the AsyncStorage throws an error. It is still in use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, componentDidMount is a component lifecycle method which will be invoked by React during runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see.
| const highScore = await AsyncStorage.getItem(HIGH_SCORE_KEY) | ||
|
|
||
| if (highScore) { | ||
| console.log('Retrieved Previous High Score:', highScore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!