Skip to content

Conversation

notcodev
Copy link

Fix notes:

  • Added cancel method to debounce function
  • Created ref that stores last debounce function
  • Cancel last debounce function when new debounce function called
  • Update last debounce function ref only when component is mounted (for strict mode support)

Test cases changes:

  • Rewrote test case responsible for checking new function when delay changes
  • Added new test case responsible for checking callbacks cancelation that called before delay changed

@notcodev notcodev changed the title Fixed useDebounceCallback behavior when delay changed [fix]: useDebounceCallback behavior when delay changed Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant