nuxt / nuxt/nuxt

`useAsyncData`: dedupe: false

Open
#30,370 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🍰 p2-nice-to-have
Dominant language
TypeScript
Stars
60.9k
Forks
5.8k
Avg merge
7h 8m
Merged PRs (30d)
162

Description

Describe the feature

Make it possible to disable deduplication of the requests. Useful for a throttled search for example.

const search = ref('')

const throttledSearch = useThrottle(search, 500)

const { data } = useFetch('/api/search', {
  query: computed(() => ({ text: throttledSearch.value })),
  immediate: !!throttledSearch.value,
  dedupe: false, // Here
})

All requests would be made and update data to update the search results as the user types.

Additional information
  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?
Final checks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the useAsyncData and useFetch implementations and inspect how their current request deduplication works. Check the related tests, then verify that setting dedupe: false allows every request to proceed and updates data with the search results as values change.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.