overmind icon indicating copy to clipboard operation
overmind copied to clipboard

Out-of-the-box features for remote data

Open cassiozen opened this issue 5 years ago • 5 comments

Recently, libraries like React Query and React SWR have proposed a new approach to data fetching with tremendous benefits for the developer (mainly Caching & invalidation) as well as some other sophisticated features like:

  • Automatic Request retries & deduplication,
  • Automatic revalidation (on focus, on network recovery...) - which keeps the application more frequently in sync with the server

The problem with those libraries is that they are React hooks, and as a consequence, the data cycle becomes tightly coupled with the components.

I love how overmind comes with powerful tools out-of-the-box (like state machines). Since data fetching ends up being so intertwined with state management, are there any thoughts on bringing an out-of-the-box developer experience regarding data fetching with the features like these?

cassiozen avatar Aug 17 '20 20:08 cassiozen

Would be awesome to have something like that. It's kind of like hte GraphQL integration. Really looking to see this coming if possible :)

EQuimper avatar Sep 15 '20 23:09 EQuimper

Would be definitely great if we have native support for these.

Found this post https://imfeld.dev/writing/swr_with_xstate a couple of days ago and I plan to enhance my Overmind implementation in the same way.

johnnypea avatar Oct 21 '20 11:10 johnnypea

Redux just announced something in this direction: https://rtk-query-docs.netlify.app/

cassiozen avatar Dec 02 '20 20:12 cassiozen

This certainly sounds interesting! I think it has to come from the community cause it would require a ton of research on my end, but I would love to advice and help out if anyone has an idea and just want help to integrate it 😄 Or if there is a more generic library we can use (like we do with graphql)

christianalfoni avatar Jan 09 '21 14:01 christianalfoni

It's been a few years now, so I'm curious what everyone interested in this ended up using as a solution.

Overmind is flexible enough that you could implement something similar yourself but it seems very wet when libs userSWR/react-query already have all that logic.

sarendipitee avatar Apr 22 '24 23:04 sarendipitee