New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

callbag-debounce

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

callbag-debounce

debounce operator for callbag

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-3.07%
Maintainers
1
Weekly downloads
 
Created
Source

Callbag debounce

Debounce operator for Callbag

Install

npm i callbag-debounce

Example

Debounces the scroll event and runs the expensiveFunction only when there is a 60ms pause.

const { fromEvent, forEach, pipe } = require("callbag-basics");
import { debounce } from "callbag-debounce";

pipe(
  fromEvent(document, "scroll"),
  debounce(60),
  forEach(expensiveFunction)
);

Changelog

4.0.0 (21/06/2021)

BREAKING CHANGE:

  • Last value is flushed even if the stream is receiving a terminate signal before the value has been debounced (fixes #12)

Before

pipe(
  of(42),
  debounce(1000),
  subscribe(console.log)
)
// Terminate without logging anything

After

pipe(
  of(42),
  debounce(1000),
  subscribe(console.log)
)
// log: 42
// Then terminate

3.0.0 (05/03/2021)

BREAKING CHANGE:

  • Timer is cleared when stream is terminated by sink (see #13)

v2.1.0 (05/03/2018)

  • error (t === 2 && d !== undefined) signals are sent right away (previously they were delayed according to the wait parameter);
  • complete (t === 2 && d === undefined) signals are sent when the last value is debounced (previously they were debounced according to the wait parameter).

v2.0.0 (01/03/2018)

codebase migrated to TypeScript. The module needs to be imported via a named import

import { debounce } from "callbag-debounce";

previously

import debounce from "callbag-debounce";

Keywords

FAQs

Package last updated on 21 Jun 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