7 Replies
Hi @tads8799. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To add debounce on search, you can use the
debounce
property in the useSelect
hook. The debounce
property allows you to delay the execution of the onSearch
function until after a certain amount of time has passed since the last time it was invoked. Here's how you can do it:
In this example, the onSearch
function will be debounced by 500 milliseconds. This means that the function will not be called until 500 milliseconds have passed since the last time it was invoked.
Please note that the debounce
property is not available in the useTable
hook based on the provided extracts. If you want to add debounce to the useTable
hook, you might need to implement it manually or check if there's an update in the refine documentation that includes this feature.
For more information, you can refer to the useSelect documentation (https://refine.dev/docs/api-reference/antd/hooks/field/useSelect/).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@577213996344803338> kapa.ai is still learning and improving, please let us know how it did by reacting below
foreign-sapphire•12mo ago
I'm using useTable, not useSelect @kapa.ai
Let me check the knowledge base for you. One moment! :books:
----------------------
I apologize for the confusion. Based on the provided extracts, the
debounce
property is not directly available in the useTable
hook. However, you can implement a debounce functionality manually in the onSearch
function using a debounce utility function.
Here's a basic example of how you can create a debounce function:
You can then use this function to debounce your onSearch
function:
Please note that this is a basic example and might need to be adjusted based on your specific use case. If you want to add debounce to the useTable
hook, you might need to check if there's an update in the refine documentation that includes this feature.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@577213996344803338> kapa.ai is still learning and improving, please let us know how it did by reacting below
foreign-sapphire•12mo ago
Fixed it to
with lodash
dependent-tan•11mo ago
ye, nice work bro