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

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

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

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Jul 4, 2021

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
use-debounce ^5.0.1 -> ^7.0.0 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 force-pushed the renovate/use-debounce-7.x branch from f7a4000 to 6003459 Compare July 5, 2021 07:24
@renovate renovate bot force-pushed the renovate/use-debounce-7.x branch from 6003459 to 8e7bc5a Compare August 30, 2021 09:37
@renovate renovate bot force-pushed the renovate/use-debounce-7.x branch from 8e7bc5a to a6c378c Compare August 30, 2021 14:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant