Skip to content

Add Generic Fn for useDebounce #2677

Description

@Ruslan-web955

For useDebounce hook add type parameter for returned Function.

Example:

const useDebounce = <F extends (...args: any[]) => any>(
	func: F,
	wait: number = 0,
): F => {
	return useMemo<F>(() => debounce(func, wait), [func, wait]);
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions