Update dependency use-debounce to v6 - autoclosed #285
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.4.3
->6.0.1
Release Notes
xnimorz/use-debounce
v6.0.1
Compare Source
useDebouncedCallback
return type. Closed useDebouncedCallback() has a slightly wrong type xnimorz/use-debounce#103 thanks to @VanTanevv6.0.0
Compare Source
breakind change: removed
callback
field, instead of thisuseDebouncedCallback
anduseThrottledCallback
returns a callable function:Old:
New:
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
anduseThrottledCallback
hasisPending
method instead ofpending
Old:
New:
get rid of
useCallback
callsimprove internal typing
decrease the amount of functions to initialize each
useDebouncedCallback
callreduce 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
v5.2.1
Compare Source
useDebounce
now. fix: function type of param with useDebounce return a wrong value xnimorz/use-debounce#95 Thanks to @csu-feizaov5.2.0
Compare Source
useThrottledCallback
v5.1.0
Compare Source
—
wait
param is optional. If you don't provide a wait argument, use-debounce will postpone a callback with requestAnimationFrame if it's in browser environment, or through setTimeout(..., 0) otherwise.v5.0.4
Compare Source
v5.0.3
Compare Source
v5.0.2
Compare Source
Add size-limit and configure it for esm modules. Now the size of the whole library is limited within 1 KB (thanks to @omgovich)
Add an export map to your package.json. (thanks to @omgovich)
Reduce bundle size (thanks to @omgovich):
Before:
Now:
Add notes about returned value from
debounced.callback
and its subsequent calls: https://github.com/xnimorz/use-debounce#returned-value-from-debouncedcallbackAdd project logo (thanks to @omgovich):
v5.0.1
Compare Source
v5.0.0
Compare Source
breaking change: Now
useDebouncedCallback
returns an object instead of array:Old:
New:
breaking change: Now
useDebounce
returns an array of 2 fields instead of a plain array:Old:
New:
Added
pending
function to bothuseDebounce
anduseDebouncedCallback
which shows whether component has pending callbacksExample:
For more details of these major changes you could check this commit xnimorz/use-debounce@1b4ac04 and this issue xnimorz/use-debounce#61
v4.0.0
Compare Source
Example:
Where the trailing edge is turned off. Let's say the function is called twice in the first 300ms. Now debounced function to have been called once.
how to migrate: Please, check your
traling: false
params withmaxWait
optionbreaking change: Now in case delay option is unset, it will be
requestAnimationFrame
delaybreaking change: Now
debouncedCallback
fromuseDebouncedCallback
returns a value. In v3 it used to returnundefined
: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.
This PR has been generated by WhiteSource Renovate. View repository job log here.