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

fix(experimental_createPersister): setQueryData, ensureQueryData supports persister #6769

Closed
wants to merge 1 commit into from

Conversation

DamianOsipiuk
Copy link
Contributor

@DamianOsipiuk DamianOsipiuk commented Jan 25, 2024

fixes #6310

This PR attempts to fix some gaps of experimental persister.

  • setQueryData/setQueriesData - can be kept as a sync function, which kicks persister in the background if defined
  • ensureQueryData - it's already async, so we can just hook up before kicking of fetch

Also small internal restructure of createPersister to allow re-usability of internals.

We still need some way to restore persisted items on-demand and in bulk.

@DamianOsipiuk DamianOsipiuk requested a review from TkDodo January 25, 2024 22:52
Copy link

vercel bot commented Jan 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
query ⬜️ Ignored (Inspect) Jan 25, 2024 10:52pm

Copy link

nx-cloud bot commented Jan 25, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 8cea6f7. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8cea6f7:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

Copy link
Collaborator

@TkDodo TkDodo left a comment

Choose a reason for hiding this comment

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

I'm not sure if this functionality should be in the query-core. Let me think about it

@TkDodo
Copy link
Collaborator

TkDodo commented Feb 13, 2024

The discussion is continuing on the issue, I posted my thoughts there. closing this because I don't think we should go in this direction

@TkDodo TkDodo closed this Feb 13, 2024
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.

setQueryData() should be persisted too, right?
2 participants