New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

time-loom

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

time-loom

[![npm version](https://badge.fury.io/js/time-loom.svg)](https://www.npmjs.com/package/time-loom) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

npmnpm
Version
1.0.3
Version published
Weekly downloads
1
-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

Time Loom

npm version License

A utility for creating delayed functions using debouncing and throttling.

Installation

npm install time-loom

Usage


const { debounce, throttle } = require('time-loom');

// Example usage of debounce
const debouncedFunction = debounce(() => {
  // Your function logic here
}, 500);

// Example usage of throttle
const throttledFunction = throttle(() => {
  // Your function logic here
}, 1000);

API

debounce(fn, delay)

Creates a debounced function.

  • fn: The function to debounce.
  • delay: The delay in milliseconds.

throttle(fn, delay)

Creates a throttled function.

  • fn: The function to throttle.
  • delay: The minimum time between invocations in milliseconds.

Examples

  • You can find more examples in the examples directory.

Author

FAQs

Package last updated on 06 Dec 2023

Related posts