Skip to content

Conversation

Mini-ghost
Copy link
Contributor

@Mini-ghost Mini-ghost commented Sep 13, 2023

Linked issue

Description

This PR implement that, let vue-query's composable APIa accepts getter function, like following:

Before

useQuery({
  queryKey: ['TODO'],
  queryFn: () =>  Promise.resolve({ data: []}),
  enabled: computed(() =>  isMounted.value && isAuth.value),
})

After

useQuery({
  queryKey: ['TODO'],
  queryFn: () =>  Promise.resolve({ data: []}),

  // Allow `MaybeRefOrGetter<boolean | undefined>`
  enabled: () => isMounted.value && isAuth.value,
})

@vercel
Copy link

vercel bot commented Sep 13, 2023

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Oct 9, 2023 2:44pm

@nx-cloud
Copy link

nx-cloud bot commented Sep 13, 2023

☁️ Nx Cloud Report

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

📂 See all runs for this branch


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 13, 2023

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 b75592e:

Sandbox Source
@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

@Mini-ghost Mini-ghost force-pushed the feature/getter-properties branch from 3217a32 to 4ee31e6 Compare September 13, 2023 16:18
@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2023

Codecov Report

All modified lines are covered by tests ✅

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files Coverage Δ
packages/vue-query/src/useBaseQuery.ts 96.34% <100.00%> (+0.13%) ⬆️
packages/vue-query/src/useQueries.ts 95.65% <100.00%> (+0.41%) ⬆️

📢 Thoughts on this report? Let us know!.

@DamianOsipiuk DamianOsipiuk merged commit a029984 into TanStack:main Oct 11, 2023
aa900031 added a commit to aa900031/ginjou that referenced this pull request Nov 1, 2023
After vue-query v4.37.0 queryOptions.enabled can be getter

Refs: TanStack/query#6004, TanStack/query#6018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants