# ✨ useDebounce

useDebounce function is used to wait for the given period of time before the next operation is run again. Limits the number of requests for the next operation.(eg. The operation is run after the given period of time regardless how many times the user clicks the button.)

# 🍁 Usage

The example usage of useDebounce function is shown below.

import { useDebounce } from 'vue-composable-utils';
const { debounceVal, value, debounceListener } = useDebounce(1000);

# 🚀 Features

useDebounce has one parameter and three properties.

Properties

Name Description
debounceVal Final value after the given time.
value The initial value that is inserted by the user.
debounceListener Is used to assign debounce value at the end of given time.

Parameter --> useDebounce(delay)

Name Description
delay The given period of time in milliseconds.

# 💐 Example

You can see how it changes reactively using the example below.

Value:


Delay is set to 1000ms.