From d427bcd71c9654a8dd05924a675f560f5334c705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Exbrayat?= Date: Mon, 2 Sep 2024 11:06:30 +0200 Subject: [PATCH] chore: document parameters of onWatcherCleanup (#11768) --- packages/reactivity/src/effect.ts | 2 +- packages/reactivity/src/watch.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/reactivity/src/effect.ts b/packages/reactivity/src/effect.ts index 11d83244289..a22990f6729 100644 --- a/packages/reactivity/src/effect.ts +++ b/packages/reactivity/src/effect.ts @@ -507,7 +507,7 @@ export function resetTracking(): void { * The cleanup function is called right before the next effect run, or when the * effect is stopped. * - * Throws a warning iff there is no currenct active effect. The warning can be + * Throws a warning if there is no current active effect. The warning can be * suppressed by passing `true` to the second argument. * * @param fn - the cleanup function to be registered diff --git a/packages/reactivity/src/watch.ts b/packages/reactivity/src/watch.ts index 9c1eea00b9b..ceda454a568 100644 --- a/packages/reactivity/src/watch.ts +++ b/packages/reactivity/src/watch.ts @@ -95,6 +95,10 @@ export function getCurrentWatcher(): ReactiveEffect | undefined { * associated effect re-runs. * * @param cleanupFn - The callback function to attach to the effect's cleanup. + * @param failSilently - if `true`, will not throw warning when called without + * an active effect. + * @param owner - The effect that this cleanup function should be attached to. + * By default, the current active effect. */ export function onWatcherCleanup( cleanupFn: () => void,