New: Introducing PHP and Composer Support.Read the Announcement
Socket
Book a DemoInstallSign in
Socket

debarrel

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debarrel

A library for NodeJS that allows you to accumulate a load of changes, then run a function after a set amount of time with those changes.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

debarrel

Node.js Test Runner GitHub code size in bytes GitHub package.json version GitHub

A library for NodeJS that allows you to accumulate a load of changes, then run a function after a set amount of time with those changes.

Installation

npm install --save debarrel

Usage

The debarrel module returns an function that can be called to mutate the cache.

Example

const debarrel = require('debarrel');

let total = 0;
const watch = debarrel(function () {
  console.log('total:', total);
}, {
  debounceTime: 100,
  maximumFlushTime: 2000
})

const increment = watch(function (increment) {
  total = total + increment;
})

// call increment. debarrel will flush every 10
const interval = setInterval(function () {
  increment(1)
}, 10);

// stop after 20 increments
setTimeout(() => {
  clearInterval(interval)
, 200);

FAQs

Package last updated on 04 Dec 2020

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