Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

fix(deps): update dependency use-debounce to v7 #468

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Jun 20, 2021

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
use-debounce ^5.2.1 -> ^7.0.1 age adoption passing confidence

Release Notes

xnimorz/use-debounce

v7.0.1

Compare Source

  • debounced object now is preserved for use-debounce between the renders. Thanks to @​msharifi99 for reporting.

v7.0.0

Compare Source

  • breaking change useDebounce hook changed isPending behavior from async reacting to the sync. Now isPending returns True as soon as the new value is sent to the hook.
  • Dev dependencies updated

v6.0.1

Compare Source

v6.0.0

Compare Source

  • breaking change: removed callback field, instead of this useDebouncedCallback and useThrottledCallback returns a callable function:
    Old:

    const { callback, pending } = useDebouncedCallback(/*...*/);
    // ...
    debounced.callback();

    New:

    const debounced = useDebouncedCallback(/*...*/);
    // ...
    debounced();
    /**
     * Also debounced has fields:
     * {
     *   cancel: () => void
     *   flush: () => void
     *   isPending: () => boolean
     * }
     * So you can call debounced.cancel(), debounced.flush(), debounced.isPending()
     */

    It makes easier to understand which cancel \ flush or isPending is called in case you have several debounced functions in your component

  • breaking change: Now useDebounce, useDebouncedCallback and useThrottledCallback has isPending method instead of pending

    Old:

    const { callback, pending } = useDebouncedCallback(/*...*/);

    New:

    const { isPending } = useDebouncedCallback(/*...*/);
    /**
     * {
     *   cancel: () => void
     *   flush: () => void
     *   isPending: () => boolean
     * }
     */
  • get rid of useCallback calls

  • improve internal typing

  • decrease the amount of functions to initialize each useDebouncedCallback call

  • reduce library size:

    Whole library: from 946 B to 899 B === 47 B
    useDebounce: from 844 to 791 === 53 B
    useDebouncedCallback: from 680 to 623 === 57 B
    useThrottledCallback: from 736 to 680 === 56 B


Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by WhiteSource Renovate. View repository job log here.

@renovate renovate bot added the renovate label Jun 20, 2021
@renovate renovate bot force-pushed the renovate/use-debounce-7.x branch 2 times, most recently from b7f57f9 to c6c871a Compare July 7, 2021 22:02
@renovate renovate bot force-pushed the renovate/use-debounce-7.x branch from c6c871a to f2daa22 Compare July 19, 2021 22:56
@renovate renovate bot force-pushed the renovate/use-debounce-7.x branch from f2daa22 to 6c82d92 Compare July 30, 2021 22:32
@renovate renovate bot force-pushed the renovate/use-debounce-7.x branch from 6c82d92 to 72fe892 Compare August 28, 2021 00:34
@renovate renovate bot force-pushed the renovate/use-debounce-7.x branch from 72fe892 to 3dda7f3 Compare October 21, 2021 00:19
@renovate renovate bot force-pushed the renovate/use-debounce-7.x branch from 3dda7f3 to 2ccb480 Compare November 7, 2021 12:43
@renovate renovate bot force-pushed the renovate/use-debounce-7.x branch from 2ccb480 to c8ee7fc Compare March 26, 2022 23:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants