From 4d875e7e6786ec924bda00d4274185c0786466d7 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 19 May 2026 22:33:20 +0200 Subject: [PATCH] docs(debounce): clarify that cancel() drops, never flushes, the trailing call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Markus on PR #629 — the cancel-not-flush contract is what the PersonMentionEditor onDestroy path relies on. Spell it out so future callers can rely on the same guarantee. Co-Authored-By: Claude Opus 4.7 --- frontend/src/lib/shared/utils/debounce.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/shared/utils/debounce.ts b/frontend/src/lib/shared/utils/debounce.ts index fb3eca9e..3d876de9 100644 --- a/frontend/src/lib/shared/utils/debounce.ts +++ b/frontend/src/lib/shared/utils/debounce.ts @@ -1,9 +1,9 @@ /** * Returns a debounced version of fn that delays invocation until after * `delay` ms have elapsed since the last call. The returned function - * exposes a `cancel()` method that clears any pending invocation — - * essential when the host context (a destroyed component, an unmounted - * editor) shouldn't fire the trailing call. + * exposes a `cancel()` method that DROPS (does not flush) the pending + * trailing invocation — essential when the host context (a destroyed + * component, an unmounted editor) shouldn't fire the trailing call. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any export function debounce void>(