Skip to content

Commit cfcd95c

Browse files
committed
fix: use reactive keys
1 parent b7523d2 commit cfcd95c

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

app/composables/useNpmRegistry.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ export function usePackage(name: MaybeRefOrGetter<string>) {
7070
const registry = useNpmRegistry()
7171

7272
return useAsyncData(
73-
`package:${toValue(name)}`,
73+
() => `package:${toValue(name)}`,
7474
() => registry.fetchPackage(toValue(name)),
75-
{ watch: [() => toValue(name)] },
7675
)
7776
}
7877

@@ -83,9 +82,8 @@ export function usePackageDownloads(
8382
const registry = useNpmRegistry()
8483

8584
return useAsyncData(
86-
`downloads:${toValue(name)}:${toValue(period)}`,
85+
() => `downloads:${toValue(name)}:${toValue(period)}`,
8786
() => registry.fetchDownloads(toValue(name), toValue(period)),
88-
{ watch: [() => toValue(name), () => toValue(period)] },
8987
)
9088
}
9189

@@ -110,8 +108,6 @@ export function useNpmSearch(
110108
}
111109
return lastSearch = await registry.searchPackages(q, toValue(options))
112110
},
113-
{
114-
default: () => lastSearch || emptySearchResponse,
115-
},
111+
{ default: () => lastSearch || emptySearchResponse },
116112
)
117113
}

0 commit comments

Comments
 (0)