Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Query Appreciation 🙂 #47

Closed
bgazzera opened this issue Nov 19, 2019 · 4 comments
Closed

React Query Appreciation 🙂 #47

bgazzera opened this issue Nov 19, 2019 · 4 comments

Comments

@bgazzera
Copy link

Just wanted to leave a note here saying thanks and great work!
Very well-thought-out API, pleasure to use.

We are using the library in a closed source (sorry) project, so I'll sponsor while my client keeps paying!

Cheers!

@tannerlinsley
Copy link
Collaborator

Thanks so much! I'm glad to hear it's helping out :)

@tannerlinsley tannerlinsley changed the title react-query appreciation issue :) React Query Appreciation 🙂 Nov 19, 2019
@aurbano
Copy link

aurbano commented Nov 27, 2019

@bgazzera @tannerlinsley don't mean to hijack your issue but I'm now deciding which async library to use for a large production app with a very complex data model (closed source, but I'm pretty sure I'll be able to get the company to sponsor :) ) and I'd love to hear your opinion

react-query looks better than any other library I've seen! - my only concern is that the data is fully managed by it, which may make certain things a little bit tricky (but should be ok as long as each mutation invalidates/updates all the relevant queries right?).

@tannerlinsley if required, would it be feasable to store the data in a central store easily?
If we load for example the current user from and endpoint (username, email... ) and this data is used in several places of the application (assuming that passing it in a prop is not feasable), would you recommend loading it from each component that needs it using useQuery, or should I store it in a centralised store? I guess that's just my main concern really, thanks again!

@tannerlinsley
Copy link
Collaborator

tannerlinsley commented Nov 27, 2019 via email

@bgazzera
Copy link
Author

Hey @aurbano our use case in this particular project is a fairly complex data model, where the app is mostly reading from APIs with few local mutations and PUT/POST back to the server.

We have been using it as @tannerlinsley mentioned above.
We have wrapped the useQuery almost every time, to allow for additional features, such as caching the results into localStorage for some calls, or for doing transformations to the data before we deliver it to the actual component, and to abstract/hide useQuery and simplify the way the consumers interact with the data (hiding react-query configuration or not returning the refetch() function if the component doesn't need it)

We haven't yet felt the need to tie the data layer to a state management library, like say, mobx. Our app is handling state using useState and very few useContexts and passing props around, as usual.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants