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

Implements the QueryCachingStrategy #69

Merged
merged 2 commits into from
Aug 18, 2024
Merged

Conversation

ogaclejapan
Copy link
Contributor

In addition to the default behavior provided by Stale-While-Revalidate, two experimental strategies are now available:

  1. Cache-First: This strategy avoids requesting data re-fetch as long as valid cached data is available. It prioritizes using the cached data over network requests.

  2. Network-First: This strategy maintains the initial loading state until data is re-fetched, regardless of the presence of valid cached data. This ensures that the most up-to-date data is always displayed.

To further customize the behavior, developers can create a class that implements the QueryCachingStrategy interface. However, please note that the experimental nature of this API means that the interface may undergo significant changes in future versions.

In future updates, we plan to provide additional options for more granular control over the behavior at the component level.

In addition to the default behavior provided by Stale-While-Revalidate, two experimental strategies are now available:

1. Cache-First:
This strategy avoids requesting data re-fetch as long as valid cached data is available. It prioritizes using the cached
data over network requests.

2. Network-First:
This strategy maintains the initial loading state until data is re-fetched, regardless of the presence of valid cached
data. This ensures that the most up-to-date data is always displayed.

To further customize the behavior, developers can create a class that implements the `QueryCachingStrategy`
interface. However, please note that the experimental nature of this API means that the interface may undergo
significant changes in future versions.

In future updates, we plan to provide additional options for more granular control over the behavior at the component
level.
@ogaclejapan ogaclejapan added the enhancement New feature or request label Aug 18, 2024
@ogaclejapan ogaclejapan merged commit ae919db into main Aug 18, 2024
@ogaclejapan ogaclejapan deleted the query-caching-strategy branch August 18, 2024 06:31
ogaclejapan added a commit that referenced this pull request Aug 25, 2024
In #69, we implemented QueryCachingStrategy. To avoid the undesired practice of continually adding more arguments with
future feature additions, we have introduced a separate configuration class specifically for Composable functions.
ogaclejapan added a commit that referenced this pull request Aug 31, 2024
We've adjusted the strategy API implemented in #69 so that it can be used for both queries and mutations as needed.

refs: #69
@github-actions github-actions bot mentioned this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant