Codemod verified
Regularly tested and maintained by our engineers and codemod expert community.
Nuxt
migration
byCodemod
Nuxt/4/Deprecated Dedupe Value
Last update
Jul 25, 2024
This codemod removes deprecated boolean values for the dedupe option in refresh calls, replacing them with string literals cancel and defer
🚦 Impact Level: Minimal
What Changed
Previously, it was possible to pass dedupe: boolean
to refresh
. These were aliases of cancel
(true) and defer
(false).
Before
const { refresh } = await useAsyncData(async () => ({ message: 'Hello, Nuxt 3!' }))async function refreshData () {await refresh({ dedupe: true })await refresh({ dedupe: false })}
After
const { refresh } = await useAsyncData(async () => ({ message: 'Hello, Nuxt 3!' }))async function refreshData () {await refresh({ dedupe: 'cancel' })await refresh({ dedupe: 'defer' })}
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community