]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: document parameters of onWatcherCleanup (#11768)
authorCédric Exbrayat <cexbrayat@users.noreply.github.com>
Mon, 2 Sep 2024 09:06:30 +0000 (11:06 +0200)
committerGitHub <noreply@github.com>
Mon, 2 Sep 2024 09:06:30 +0000 (17:06 +0800)
packages/reactivity/src/effect.ts
packages/reactivity/src/watch.ts

index 11d832442891b76d610d6d6bfb53a2dbe9bc3ddb..a22990f67296b65afbf212554528ef2f7401703f 100644 (file)
@@ -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
index 9c1eea00b9b7d6fafc0f4975b2321cd72cfcc3f9..ceda454a568dfd3d65a9be9b7370059bd9b15497 100644 (file)
@@ -95,6 +95,10 @@ export function getCurrentWatcher(): ReactiveEffect<any> | 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,