From 238817285d59698b6eff01c90a700a1c976b024f Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 17 Jan 2025 12:35:14 +0000 Subject: [PATCH] perf: remove warning default value --- src/composables/useArrayData.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index c13c4f9a6..6fb22a340 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -7,7 +7,9 @@ import { isDialogOpened } from 'src/filters'; const arrayDataStore = useArrayDataStore(); -export function useArrayData(key = useRoute().meta.moduleName, userOptions) { +export function useArrayData(key, userOptions) { + key ??= useRoute().meta.moduleName; + if (!key) throw new Error('ArrayData: A key is required to use this composable'); if (!arrayDataStore.get(key)) arrayDataStore.set(key);