Skip to content

Commit

Permalink
Merge pull request #169 from koenpunt/patch-1
Browse files Browse the repository at this point in the history
Remove incorrect docblock about obsolete .callback property
  • Loading branch information
xnimorz authored Nov 24, 2023
2 parents 24fc538 + 806942a commit 1d0a0df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/useDebouncedCallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export interface ControlFunctions {
}

/**
* Subsequent calls to the debounced function `debounced.callback` return the result of the last func invocation.
* Note, that if there are no previous invocations it's mean you will get undefined. You should check it in your code properly.
* Subsequent calls to the debounced function return the result of the last func invocation.
* Note, that if there are no previous invocations you will get undefined. You should check it in your code properly.
*/
export interface DebouncedState<T extends (...args: any) => ReturnType<T>>
extends ControlFunctions {
Expand Down
4 changes: 2 additions & 2 deletions src/useThrottledCallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ import useDebouncedCallback, {
* window.addEventListener('scroll', scrollHandler)
*
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
* const { callback } = useThrottledCallback(renewToken, 300000, { 'trailing': false })
* <button onClick={callback}>click</button>
* const throttled = useThrottledCallback(renewToken, 300000, { 'trailing': false })
* <button onClick={throttled}>click</button>
*
* // Cancel the trailing throttled invocation.
* window.addEventListener('popstate', throttled.cancel);
Expand Down

0 comments on commit 1d0a0df

Please sign in to comment.