globalbrain / sefirot

Global Brain Design System.
https://sefirot.globalbrains.com
MIT License
151 stars 12 forks source link

feat(api): allow watching options in useQuery #466

Closed brc-dd closed 7 months ago

brc-dd commented 7 months ago

Before:

export function usePostPage(options: MaybeRefOrGetter<UsePostPageOptions>) {
  const query = useQuery(async (http) => {...})

  watch(() => toValue(options), query.execute, { deep: true })

  return query
}

After:

export function usePostPage(options: MaybeRefOrGetter<UsePostPageOptions>) {
  return useQuery(async (http) => {...}, { watch: () => toValue(options) })
}

Nuxt's useAsyncData also supports passing watch sources, so useQuerySsr already supports this.

netlify[bot] commented 7 months ago

Deploy Preview for sefirot-docs ready!

Name Link
Latest commit f824b18b5cb006041b4ee58f36d427a651cf807f
Latest deploy log https://app.netlify.com/sites/sefirot-docs/deploys/65c1c2d3addb9d000853cc9f
Deploy Preview https://deploy-preview-466--sefirot-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] commented 7 months ago

Deploy Preview for sefirot-story ready!

Name Link
Latest commit f824b18b5cb006041b4ee58f36d427a651cf807f
Latest deploy log https://app.netlify.com/sites/sefirot-story/deploys/65c1c2d3546601000723df52
Deploy Preview https://deploy-preview-466--sefirot-story.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.