Skip to content

Feature/add cache time #88

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

Merged
merged 3 commits into from
Apr 16, 2025
Merged

Feature/add cache time #88

merged 3 commits into from
Apr 16, 2025

Conversation

k-ode
Copy link
Contributor

@k-ode k-ode commented Apr 15, 2025

No description provided.

@k-ode k-ode requested a review from Copilot April 15, 2025 19:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces caching functionality for MST queries by adding cacheKey and cacheTime support. Key changes include:

  • Adding new tests to validate cache behavior.
  • Extending CacheOptions through hooks, create, and query handler modules.
  • Implementing caching logic in QueryStore and updating QueryClient defaults.

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/mst-query/tests/mstQuery.test.tsx Adds tests for cacheKey and cacheTime functionality.
packages/mst-query/src/hooks.ts Extends query options with CacheOptions.
packages/mst-query/src/create.ts Updates setData signature to accept cache options.
packages/mst-query/src/QueryStore.ts Introduces a dedicated cache map and timeout mechanism for query data caching.
packages/mst-query/src/QueryClient.ts Adds a cacheTime default to the queryOptions.
packages/mst-query/src/MstQueryHandler.ts Adjusts query flow and data hydration to integrate cache logic using CacheOptions.
Files not reviewed (2)
  • packages/mst-query/package-lock.json: Language not supported
  • packages/mst-query/package.json: Language not supported

@k-ode k-ode requested a review from jonasdunkel April 15, 2025 19:15
@k-ode k-ode merged commit 0b9b3a7 into main Apr 16, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant