Merge pull request 'perf: remove warning default value' (!1241) from warning_defaultValue_firstParam into dev
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #1241
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Javier Segarra 2025-01-20 17:30:10 +00:00
commit 0f8edae458
1 changed files with 3 additions and 1 deletions

View File

@ -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);