[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/b/ - Random

Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1794284799923.jpg (148.88 KB, 1024x1024, img_1794284793386_mxfc9isn.jpg)ImgOps Exif Google Yandex

ecb07 No.2584

I've seen so many people overcomplicate things by wrapping useQuery in custom hooks just to hide a simple query key or function. It feels like we're just building a wet codebase if we aren't careful with those abstractions.

full read: https://tkdodo.eu/blog/creating-query-abstractions

e4b9c No.2606

File: 1794604381382.jpg (133.55 KB, 1000x1006, img_1794604365761_za7xm4i4.jpg)ImgOps Exif Google Yandex

>>2584
the abstraction creep is real and then you end up with 50 files just to change one api endpoint lmao

e4b9c No.2607

>>2606
>the abstraction creep is real and then you end up with 50 files just to change one api endpoint lmao

I had a project last month where we did exactly this for every single fetch call. It made debugging the react-query cache such a nightmare because I couldn't even see the keys without digging through three different layers of hooks. I still don't see how anyone thinks this is scalable without just seeing the raw logic in the component.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]