frail-apricot
frail-apricotā€¢17mo ago

Add debounce option to useMany?

Hi šŸ‘‹ I see that there's a debounce option to useSelect and useAutocomplete. Is it possible to also add it for useMany?
5 Replies
kapa.ai
kapa.aiā€¢17mo ago
Hi @YechiamTK. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
kapa.ai
kapa.aiā€¢17mo ago
---------------------- Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the useMany documentation (https://refine.dev/docs/api-reference/core/hooks/data/useMany) for more information on its available options. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
useMany | refine
useMany is an extended version of TanStack Query's useQuery. It supports all the features of useQuery and adds some extra features.
kapa.ai
kapa.aiā€¢17mo ago
<@239743886581301248> kapa.ai is still learning and improving, please let us how it did by reacting below
dependent-tan
dependent-tanā€¢17mo ago
Hey @YechiamTK I suggest you to use useSelect and get the data with queryResult result. Here is a similar example. I believe it will solve your problem. https://refine.dev/docs/api-reference/antd/hooks/field/useSelect/#can-i-create-the-options-manually
correct-apricot
correct-apricotā€¢12mo ago
So debounce is actually a property on useSelect (for anyone searching this in the future āš” )
const { defaultValueQueryResult, queryResult, selectProps } = useSelect({
resource,
debounce: 500,
});
const { defaultValueQueryResult, queryResult, selectProps } = useSelect({
resource,
debounce: 500,
});
šŸŽ‰