Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

debounce-queue

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debounce-queue

Like lodash.debounce but you get an array of all previous (unique) events

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
614
decreased by-4.95%
Maintainers
1
Weekly downloads
 
Created
Source

debounce-queue

npm

Debounce that gives you an array of all previous events instead of just the last one.

Install

npm install debounce-queue --save

Usage

Example

import { watch } from 'fs'
import debounce from 'debounce-queue'

watch('.', debounce(list => {
  for(const [eventType, filename] of list) {
    ...
  }
}))

API

debounce(func, opts)
  • func <function>(required) The function to debounce
  • opts [number|object] Options or wait
  • opts.wait [number=0] The number of milliseconds to delay
  • opts.leading [boolean=false] Specify invoking on the leading edge of the timeout.
  • opts.maxWait [number] The maximum time func is allowed to be delayed before it's invoked.
  • opts.trailing [boolean=true] Specify invoking on the trailing edge of the timeout.

FAQs

Package last updated on 26 Dec 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc