Comments (3)
@ryanashcraft thanks a lot. I'll think a little bit more.
@MrNice this sounds oversimplified, but this one I totally get it :)
from redux-query.
Thanks for the kinds words. π Yeah I admit this is confusing and there's things to be done here to make it less so β from docs/runtime warnings/different behaviors.
Let me quickly outline a few of the motivations behind the differences:
- every "entities" collection are safe boundaries for this problem. simultaneous requests for different entities should never be a problem.
- requests should be non-destructive, therefore it's OK to let the latest request to complete "win" because order shouldn't matter. request update functions should be written in a safe way that behaves correctly regardless of the order in which the requests return.
- mutations are destructive, therefore you run into problems when you issue multiple mutations for the same entity. redux-query doesn't have a built-in mechanism for handling conflicts when this happens. it actually discourages this behavior (in a horrible, silent way) by using the same entities state you had when you dispatched
mutateAsync
. one possible solution we've discussed for this problem is to queue mutations based on the entities that they update.
Let me know if you have any questions or if that doesn't make sense. I do plan on addressing some of these aforementioned problems in the futureβ¦
from redux-query.
@rogovdm I think about requests as data reads from network and mutations as data writes to network, similarly to action Creators being state writes and selectors being state reads. I hope that helps!
from redux-query.
Related Issues (20)
- React redux v6 support? HOT 3
- Body is not being stringified and appended to the URL as query params. HOT 4
- Feature Request - Return data on repeated requests. HOT 3
- useRequest and useMutation not working property with custom middlewares HOT 6
- Feature Request - Add useRequests hooks HOT 5
- use options.header to re-memoize query configs HOT 8
- Accessing store in network interface
- useMutation error after Typescript update HOT 1
- Lazy loaded useMutation HOT 7
- Problem with useRequest HOT 2
- Feature request - Debounce HOT 3
- Testing redux-query HOT 1
- Can't use useRequest with Typescript HOT 5
- isPending Bug on useRequest HOT 4
- Mutation Promise chain setup HOT 3
- Problem with CRA code and the query middleware? HOT 1
- Question about where to put side effects HOT 5
- How can I clear all cached queries and fetch it all again after logout. HOT 1
- Handling errors HOT 1
- Need a code snippet on how to implement forceRequest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-query.