Skip to content

Conversation

@Gerbuuun
Copy link
Contributor

@Gerbuuun Gerbuuun commented Jan 25, 2025

created this PR in favor of #18

resolves #13

The current api is as follows:

return {
  data: computed(() => view.value.data),
  status: computed(() => view.value.resultDetails.type),
}

because resultType indicates the sync status of the query

  • complete the query is fully in sync with the source db
  • unknown showing cached data and checking / in progress of sync

Then it is very similar to useFetch and useAsyncData (although with different values for status)
discord thread: https://discord.com/channels/830183651022471199/1331688836929159270

@socket-security
Copy link

socket-security bot commented Jan 25, 2025

New and updated dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@rocicorp/zero@0.12.2025013100 🔁 npm/@rocicorp/zero@0.11.2025011402 Transitive: eval, filesystem, shell, unsafe +226 57.9 MB aboodman

View full report↗︎

@arv
Copy link
Collaborator

arv commented Jan 30, 2025

I like the word status. I think that is better than type. I'll file an issue to update our API.

@danielroe danielroe changed the title feat: upgrade and support zero@0.12 feat!: upgrade to zero v0.12 and expose query status Feb 4, 2025
Copy link
Owner

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

nice work - thank you ❤️

@danielroe danielroe merged commit 5d43ae0 into danielroe:main Feb 4, 2025
6 checks 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.

Return query details along with current query value from useQuery

3 participants