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

[Feature Request] Add hasCache prop to Relay readyState? #23

Open
SatyaFariz opened this issue Apr 20, 2019 · 1 comment
Open

[Feature Request] Add hasCache prop to Relay readyState? #23

SatyaFariz opened this issue Apr 20, 2019 · 1 comment

Comments

@SatyaFariz
Copy link

Sorry this isn't an issue but rather a feature request

I'd like to programmatically check if there is a cache hit in the render prop so that i can pass has hasCache prop to my component. So this is my use case:
I want to increase perceived performance in my RN app without caching my screen. I thought I could just use QueryRenderer with caching enabled by default then pass hasCache prop to my component. Then I could just refetch the whole data when that component is mounted using relay modern createRefetchContainer only if there is a cache hit. That way I could drastically improve perceived performance of my app.

@robrichard
Copy link
Member

@SatyaFariz, the official QueryRenderer bundled with Relay has a prop dataFrom=STORE_THEN_NETWORK. It sounds like this is pretty close to what you are trying to accomplish.

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