![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@wetransfer/concorde-debounce
Advanced tools
Debounce functions for regular and async functions.
Debounce functions. Handy functions to debounce regular and async function executions.
npm install @wetransfer/concorde-cookie --save
Import the package if your are using a package bundler like Webpack or Parcel:
import { debounce } from '@wetransfer/concorde-debounce';
let counter = 0;
const debounced = debounce(() => counter++);
debounced();
debounced();
debounced();
console.log(counter); // => 1
Or load directly the final bundle on your browser, using a script tag. All concorde.js modules will be available in a global variable called WT
:
<!-- This will load the latest version of @wetransfer/concorde-debounce module -->
<script src="https://unpkg.com/@wetransfer/concorde-debounce/dist/concorde-debounce.min.js"></script>
<script>
var counter = 0;
var debounced = WT.debounce.debounce(function() {
return counter++;
});
debounced();
debounced();
debounced();
setTimeout(function() {
console.log(counter); // => 1
});
</script>
const { debounce } = require('@wetransfer/concorde-debounce');
let counter = 0;
const debounced = debounce(() => counter++);
debounced();
debounced();
debounced();
console.log(counter); // => 1
In case you want to develop/debug this module while integrating with other project, please follow these steps:
npm link
to create a global symlink to that modulenpm run build:watch
to listen to changes and rebuild the modulenpm link @wetransfer/concorde-debounce
Check the available documentation on wetransfer.github.io.
FAQs
Debounce functions for regular and async functions.
The npm package @wetransfer/concorde-debounce receives a total of 0 weekly downloads. As such, @wetransfer/concorde-debounce popularity was classified as not popular.
We found that @wetransfer/concorde-debounce demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.