You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restful implementations generally offer the ability to select a list of entities or to "drill down" and get just a single one. Wondering if there is any official guidance on fetching these "lists"?
An example might be a list of users pulling from routes like users/ and users/${id}. Say we have two components: Users - lists all the users. User represents a single user. Is also responsible for mutating/updating the user:
|------------------------------------------|
| System Users | <--- Users component
| |
| |--------------------------------------| |
| | Name: User 1 | | <--- User component
| |--------------------------------------| |
| |
| |--------------------------------------| |
| | Name: User 2 | | <--- User component
| |--------------------------------------| |
|------------------------------------------|
The challenge is keeping the parts of the cache in sync while minimizing network traffic.
How could the data be loaded so that cache for both users/ and user/1 is set? (the is no need to load user/1 from the server at all)
How should the data be mutated so that both users/ and user/1 are updated? (seems wasteful to reload users/ from the server)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi -
Restful implementations generally offer the ability to select a list of entities or to "drill down" and get just a single one. Wondering if there is any official guidance on fetching these "lists"?
An example might be a list of users pulling from routes like
users/
andusers/${id}
. Say we have two components:Users
- lists all the users.User
represents a single user. Is also responsible for mutating/updating the user:The challenge is keeping the parts of the cache in sync while minimizing network traffic.
users/
anduser/1
is set? (the is no need to loaduser/1
from the server at all)users/
anduser/1
are updated? (seems wasteful to reloadusers/
from the server)Thanks!
Beta Was this translation helpful? Give feedback.
All reactions