4 ms·
I don't know why the author shits on the idea of using react-query so much. That's essentially what they implemented, as it does optimistic writes, caching, rev
by Capricorn2481 2y ago
I don't know why the author shits on the idea of using react-query so much. That's essentially what they implemented, as it does optimistic writes, caching, revalidating and keeps it separate from the components.
- masylum 2y agoI don't shit on anything, the first part is just a parody.
- Capricorn2481 2y agoLet me rephrase, you weren't shitting on react-query and I don't really feel offended by the parody. But the person suggesting it was treated in the story like it was a non-sequitur and then you went on to describe something in the technical part of the article that was basically react-query. Is there a reason making their own sync engine was more practical than just using react-query?
- crabmusket 2y agoTanstack Query doesn't actually store data for you, it just caches what comes back from the queryFn. You would still need to implement your own data store, e.g. using IndexedDB or OPFS. And if you wanted both a local data store for offline writes and a network connected backend when available... I'm pretty sure you'd be doing a lot of extra work yourself. That's what a sync engine should give you, I think.