Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
debounce-execution
Advanced tools
Debounce will collapse multiple requests (if any) for a named task into one invocation which will execute after the given wait time has passed.
Debounce will collapse multiple requests (if any) for a named task into one invocation which will execute after the given wait time has passed. By default the latest request for a task will be executed after the given wait time, but it is possible to execute the first request and block any future requests until the given wait time has passed.
$ npm install debounce-execution --save
v1.0.7
v1.0.6
debounce-execution/typed
instead.debounce-execution/native
instead.Debounce sports one method: debounce(func: function, waitTime?: number = 0, immediate?: boolean = false): void
.
This allows you to do:
let scrollhandler = () => debounce(onScroll, 200);
container.addEventListener("scroll", scrollHandler);
function onScroll () {
// Any scroll events fired within the last 200ms has been collapsed and only
// the last event made this function execute.
}
If immediate is true, the first request is executed and then any requests within the given waitTime will be blocked:
let touchStartHandler = () => debounce(onTouchStart, 100, true);
container.addEventListener("touchstart", touchStartHandler);
function onTouchStart (e) {
//Only the first touch event within the next 100ms will execute this function.
}
Simply do npm install debounce-execution --save
;
And then all that's left is to import what you want:
import Debounce from "debounce-execution"; // Transpiled to ES5
// or
import Debounce from "debounce-execution/typed" // With Flow typings and ES-modules
// or
import Debounce from "debounce-execution/native" // With native ES-modules.
The standard version works with amd
, umd
, commonjs
and iife
:
const Debounce = require("debounce-execution");
Copyright (c) 2016 Dlmma IVS. Released under the MIT license.
FAQs
Debounce will collapse multiple requests (if any) for a named task into one invocation which will execute after the given wait time has passed.
The npm package debounce-execution receives a total of 11 weekly downloads. As such, debounce-execution popularity was classified as not popular.
We found that debounce-execution demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.