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

How to deal with partial resources #9

Closed
skoging opened this issue Mar 11, 2019 · 3 comments
Closed

How to deal with partial resources #9

skoging opened this issue Mar 11, 2019 · 3 comments

Comments

@skoging
Copy link
Contributor

skoging commented Mar 11, 2019

As far as I can see, there isn't currently a robust way to handle requests that return partial resources.

In particular, I want to do a list request where I only want to request a couple of the fields of a resource. Then I will request the complete resource when I need it. This works as expected, where the detailed resource replaces the existing partial resource. The problem is that if I reverse the order of these requests.
Say I'm at a detail page, and navigate back to the list page, if the list request is stale or not in the cache, the partial resources that are fetched will replace any complete resource that is already cached.

Are there any suggestions for how to deal with this? Or plans for improvements that will make this use case possible?

@skoging
Copy link
Contributor Author

skoging commented Mar 11, 2019

I did dome more testing, and it appears lodash merge deals with class instances differently to plain objects.

https://runkit.com/skoging/5c866ccaa0922f0014c0835e

In particular, classes are not recursively merged, so undefined fields are not skipped.

@skoging
Copy link
Contributor Author

skoging commented Mar 16, 2019 via email

@ntucker
Copy link
Collaborator

ntucker commented Mar 30, 2019

#10

@ntucker ntucker closed this as completed Mar 30, 2019
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

2 participants