Closed ealush closed 8 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
vest | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 2, 2024 9:07pm |
vest-next | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 2, 2024 9:07pm |
| Related issues | #1057 1057 |
debounce()
The
debounce()
function in Vest helps you optimize function execution by introducing a delay. This is useful in scenarios where a function is called repeatedly due to user interaction, and you only want to execute the latest version after a period of inactivity.Usage
1. Import Debounce
2. Wrap your Test Callback:
In the above example, Vest will wait for two seconds before executing the test, and it will be run only once, no matter how many times the suite was invoked during this time period.