![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
debounce-fn
Advanced tools
Readme
Debounce a function
npm install debounce-fn
import debounceFn from 'debounce-fn';
window.onresize = debounceFn(() => {
// Do something on window resize
}, {wait: 100});
Returns a debounced function that delays calling the input
function until after wait
milliseconds have elapsed since the last time the debounced function was called.
It comes with a .cancel()
method to cancel any scheduled input
function calls.
Type: Function
Function to debounce.
Type: object
Type: number
Default: 0
Time in milliseconds to wait until the input
function is called.
Type: number
Default: Infinity
The maximum time the input
function is allowed to be delayed before it's invoked.
This can be used to limit the number of calls handled in a constant stream. For example, a media player sending updates every few milliseconds but wants to be handled only once a second.
Type: boolean
Default: false
Trigger the function on the leading edge of the wait
interval.
For example, can be useful for preventing accidental double-clicks on a "submit" button from firing a second time.
Type: boolean
Default: true
Trigger the function on the trailing edge of the wait
interval.
FAQs
Debounce a function
The npm package debounce-fn receives a total of 673,781 weekly downloads. As such, debounce-fn popularity was classified as popular.
We found that debounce-fn demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.