npm

Don't miss out on this year's npm Pride t-shirt designs!Order your favorites here »

callbag-debounce

2.1.2 • Public • Published

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

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

install

npm i callbag-debounce

Downloadsweekly downloads

288

version

2.1.2

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability