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

debounce-stream

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debounce-stream

Debounces a stream.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
819
decreased by-7.56%
Maintainers
2
Weekly downloads
 
Created
Source

debounce-stream

Debounces a stream.

Build Status npm install

Example

var events = require('dom-delegation-stream')
  , values = require('dom-value-object-stream')
  , debounce = require('debounce-stream')

events(document.querySelector('[rel=inputs]'), 'input')
  .pipe(values()) // values is a stream that progressively updates on user input
  .pipe(debounce(500)) // emit only after a pause of 500 ms
  .on('data', function(data) {
    console.log(data) // the data after a user has stopped typing for 500 ms
  })

API

  • debounce([milliseconds] [, immediate]) - Create a new debounce duplex stream
    • milliseconds - Integer. The number of milliseconds to debounce the stream. Defaults to 100
    • immediate - Boolean. If true, the debounced function will call immediately, rather than at the end of input. Default is false.

Returns a duplex stream that accepts values on one end, and emits the debounced values on the other.

Notes

This module which was previously known as stream-debounce is now known as debounce-stream. Thanks to RangerMauve for allowing this module to take over that name! The version was bumped to v2.0.0 for the name change, and to ensure compatibility for users of the old version.

License

MIT. See LICENSE for details.

Keywords

FAQs

Package last updated on 20 Feb 2015

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