Skip to content

Commit

Permalink
feat(debounce): add handler property
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jul 13, 2024
1 parent 87207f3 commit 2268288
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/curry/debounce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export interface DebounceFunction<TArgs extends any[] = any> {
* `undefined` will be returned.
*/
flush(...args: TArgs): void
/**
* The underlying function
*/
readonly handler: (...args: TArgs) => void
}

/**
Expand Down Expand Up @@ -69,6 +73,7 @@ export function debounce<TArgs extends any[]>(
}

debounced.isPending = () => timeout !== undefined
debounced.handler = handler

return debounced
}

0 comments on commit 2268288

Please sign in to comment.