fullstacksjs / toolbox

A zero-dependency 📦 tree-shakable🌲 collection of missing JavaScript utilities.
https://toolbox.fullstacksjs.com/
MIT License
56 stars 15 forks source link

[Proposal]: throttle #45

Closed ASafaeirad closed 1 year ago

ASafaeirad commented 1 year ago

Scope

function

Function Signature

function throttle<T extends Function>(options: { interval: number; isImmediate?: boolean }, f: T): T

Motivation

In numerous applications, there are functions that are executed frequently, such as during window resizing, text input, or mouse movements. These repeated function calls might cause performance bottlenecks, particularly when they lead to hefty computations or disruptive visual updates.

The throttle function serves to control the execution rate of a function.

hamed-bavar commented 1 year ago

may I work on this issue?

ASafaeirad commented 1 year ago

Of course, feel free to open a PR

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 4.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: