🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

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.0
Version published
Weekly downloads
15
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

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