this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

final thought

+23 -14
+23 -14
src/pages/posts/crc-cards-as-training-material.mdx
··· 216 216 collaborators={["Home.tsx"]} 217 217 /> 218 218 219 - And here its final CRC Card: 220 - 221 - <CrcCard 222 - name="UserBookmarks" 223 - responsabilities={[ 224 - "Retrieve bookmarks", 225 - "handling async processes (loading, error)", 226 - "display user bookmarks", 227 - "display 'add bookmark' button", 228 - ]} 229 - collaborators={["Home.tsx"]} 230 - /> 231 - 232 219 ## Simplification 233 220 234 221 Once we said all that, let's relook our component: less responsability and less hooks. ··· 299 286 } 300 287 ``` 301 288 289 + And here its final CRC Card: 290 + 291 + <CrcCard 292 + name="UserBookmarks" 293 + responsabilities={[ 294 + "Retrieve bookmarks", 295 + "handling async processes (loading, error)", 296 + "display user bookmarks", 297 + "display 'add bookmark' button", 298 + ]} 299 + collaborators={[ 300 + "Home.tsx", 301 + "Title", 302 + "ErrorMessage", 303 + "useUserBookmarksQuery", 304 + "Bookmarks", 305 + "AddBookmarkButton", 306 + ]} 307 + /> 308 + 302 309 ## Final thought 303 310 304 - What a 311 + What a cleanup! Looks like `UserBookmarks` does not do anything at all and delegate everything as there are more collaborators now! 312 + 313 + That's the goal, delegation is for me underrated, we tend to extend too easily existing files instead of creating new files with clear responsability. Now I'm pretty sure what I'll encounter on the `useUserBookmarksQuery`, `TilesSkeleton`, `Bookmarks` and `AddBookmarkButton` and if I need to specify a new prop coming from the user to display bookmarks, for instance has the user's authorization to add bookmark? I know where I'll start: `UserBookmarks`. 305 314 306 315 ## Playground 307 316