-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Describe the feature
Greetings,
I am currently implementing a scenario using this package. In the case of searching for a product by name, I would like to have my reactive URL, reactive form, and reactive API request all share the same ref. The code structure would look something like this:
// Updates the URL synchronously
const { search } = useRouteQuery("search")
// Validates the input
const { values } = useForm({
initialValues: {
search: search,
}
}
// Allows reusability of this composable in other components
const { products, pending, error, refresh } = await useProducts({
params: {
search: search
}
})When designing the useProducts function, I modified the type of useProductsOption.params.search to type MaybeRef<T> = T | Ref<T>, allowing it to accept a ref and share the same set of ref variables. I would like to inquire whether the initialValues of useForm can achieve this functionality.
Perhaps there is a better way to solve my issue of sharing the same ref? I would like to hear your suggestions.
Cheers
Additional information
- Would you be willing to help implement this feature?
reslear
Metadata
Metadata
Assignees
Labels
No labels