Skip to content

Есть тип DebouncedFunction, но нет ThrottledFunction #727

@al3xnag

Description

@al3xnag

export function debounce<T extends any[]>(
fn: (...args: T) => unknown,
delay: number,
context = typeof window !== 'undefined' ? window : undefined,
): DebouncedFunction<T> {

export function throttle<T extends any[]>(
fn: (...args: T) => unknown,
threshold = 50,
scope = typeof window !== 'undefined' ? window : undefined,
) {

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions