0
0
Fork 0

unify watchers

This commit is contained in:
Alex Moreno 2024-08-09 12:27:24 +02:00
parent bd05460b90
commit 02cfa54a40
1 changed files with 5 additions and 7 deletions

View File

@ -97,13 +97,11 @@ function setUserParams(watchedParams) {
}
watch(
() => route.query[$props.searchUrl],
(val, oldValue) => (val || oldValue) && setUserParams(val)
);
watch(
() => arrayData.store.userParams,
(val, oldValue) => (val || oldValue) && setUserParams(val)
() => [route.query[$props.searchUrl], arrayData.store.userParams],
([newSearchUrl, newUserParams], [oldSearchUrl, oldUserParams]) => {
if (newSearchUrl || oldSearchUrl) setUserParams(newSearchUrl);
if (newUserParams || oldUserParams) setUserParams(newUserParams);
}
);
watch(