Skip to content

Commit d427bcd

Browse files
authored
chore: document parameters of onWatcherCleanup (#11768)
1 parent a3c104d commit d427bcd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/reactivity/src/effect.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ export function resetTracking(): void {
507507
* The cleanup function is called right before the next effect run, or when the
508508
* effect is stopped.
509509
*
510-
* Throws a warning iff there is no currenct active effect. The warning can be
510+
* Throws a warning if there is no current active effect. The warning can be
511511
* suppressed by passing `true` to the second argument.
512512
*
513513
* @param fn - the cleanup function to be registered

packages/reactivity/src/watch.ts

+4
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ export function getCurrentWatcher(): ReactiveEffect<any> | undefined {
9595
* associated effect re-runs.
9696
*
9797
* @param cleanupFn - The callback function to attach to the effect's cleanup.
98+
* @param failSilently - if `true`, will not throw warning when called without
99+
* an active effect.
100+
* @param owner - The effect that this cleanup function should be attached to.
101+
* By default, the current active effect.
98102
*/
99103
export function onWatcherCleanup(
100104
cleanupFn: () => void,

0 commit comments

Comments
 (0)