You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -46,12 +46,10 @@ Features that aren't checked below are yet to be implemented. If you want to imp
46
46
47
47
### TODO
48
48
49
-
-[ ] Add features not checked above
50
-
-[ ] Fix and improve comment fetching.
51
-
- Comments are fetched recursively due to Hacker News's API design, then flattened into an array where each reply is the next item in the array. This isn't a good solution for two reasons:
52
-
1. The user has to wait for all the comments to be loaded before they can see any (`Promise.all()`).
53
-
2. If a component unmounts (the user goes back to the feed), all the comments still get fetched, causing the JS thread to drop frames.
54
-
- To fix this comments and comment replies should be fetched individually, appended to an array and the component will re render with the new comment added. If the component unmounts, simply stop fetching comments. The user will also be able to view comments almost immediately while others load.
49
+
-[ ] Add features not implemented above
50
+
-[x] Fix and improve comment fetching.
51
+
- Comments are fetched recursively due to Hacker News's API design, then flattened into an array where each reply is the next item in the array. This isn't a good solution beacuse the user has to wait for all the comments to be loaded before they can see any (`Promise.all()`).
52
+
- To fix this, each top comment and its replies should be fetched individually, appended to an array and the component will re render with the new comment added. The user will also be able to view comments almost immediately while others load.
55
53
-[ ] Add caching for comments (older than 10 minutes), and posts. If post/comment requested again, check if in cache, if so load from cache.
0 commit comments