Skip to content

Commit 0751874

Browse files
committed
fixup: more comments
Signed-off-by: Todd Baert <[email protected]>
1 parent f774dbb commit 0751874

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libs/hooks/debounce/src/lib/debounce-hook.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ export type Options<T extends FlagValue = FlagValue> = {
9797
maxCacheItems: number;
9898
};
9999

100+
/**
101+
* A hook that wraps another hook and debounces its execution based on the provided options.
102+
* Each stage of the hook (before, after, error, finally) is debounced independently.
103+
* If a stage is called with a cache key that has been seen within the debounce time, the inner hook's stage will not run.
104+
* If no cache key supplier is provided for a stage, that stage will always run.
105+
*/
100106
export class DebounceHook<T extends FlagValue = FlagValue> implements Hook {
101107
private readonly cache: FixedSizeExpiringCache<true | CachedError>;
102108
private readonly cacheErrors: boolean;

0 commit comments

Comments
 (0)