alleyinteractive/alley-scripts

Deprecate useDebounce in favor of the version in @wordpress/compose

Opened this issue · 4 comments

User Story

As a package maintainer, I want to use the debounce functionality provided by WordPress rather than relying on a third party library.

Acceptance Criteria

  • Deprecate the custom useDebounce hook in Block Editor Tools (print a console warning when it is called the first time) and instruct users to migrate to useDebounce from @wordpress/compose instead.
  • Update documentation to indicate that this hook has been deprecated and indicate that it will be removed in a future version.

One can use as such:

import { useDebounce } from '@wordpress/compose';

Fantastic, that's even better. I'll update the issue to reflect that.

Just a note that, the way the hook from WordPress works is different from the version here and from @uidotdev. So it is not a 1:1 replacement.