Skip to content

Commit 19bdf3e

Browse files
refactor: change name of composable
1 parent 83b052f commit 19bdf3e

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

app/components/Package/TrendsChart.vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,9 @@ const effectivePackageNames = computed<string[]>(() => {
319319
return single ? [single] : []
320320
})
321321
322-
const selectedGranularity = usePermalinkValue<ChartTimeGranularity>(
323-
'granularity',
324-
DEFAULT_GRANULARITY,
325-
{
326-
permanent: props.permalink,
327-
},
328-
)
322+
const selectedGranularity = usePermalink<ChartTimeGranularity>('granularity', DEFAULT_GRANULARITY, {
323+
permanent: props.permalink,
324+
})
329325
330326
const displayedGranularity = shallowRef<ChartTimeGranularity>(DEFAULT_GRANULARITY)
331327
@@ -356,10 +352,10 @@ const shouldRenderEstimationOverlay = computed(
356352
() => !pending.value && isEstimationGranularity.value,
357353
)
358354
359-
const startDate = usePermalinkValue<string>('start', '', {
355+
const startDate = usePermalink<string>('start', '', {
360356
permanent: props.permalink,
361357
})
362-
const endDate = usePermalinkValue<string>('end', '', {
358+
const endDate = usePermalink<string>('end', '', {
363359
permanent: props.permalink,
364360
})
365361
@@ -587,7 +583,7 @@ const METRICS = computed<MetricDef[]>(() => [
587583
},
588584
])
589585
590-
const selectedMetric = usePermalinkValue<MetricId>('facet', DEFAULT_METRIC_ID, {
586+
const selectedMetric = usePermalink<MetricId>('facet', DEFAULT_METRIC_ID, {
591587
permanent: props.permalink,
592588
})
593589
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Creates a computed property that uses route query parameters by default,
33
* with an option to use local state instead.
44
*/
5-
export function usePermalinkValue<T extends string | number = string>(
5+
export function usePermalink<T extends string | number = string>(
66
queryKey: string,
77
defaultValue: T = '' as T,
88
options: { permanent?: boolean } = {},

0 commit comments

Comments
 (0)